```javascript
const dataSources = computed(() => {
try {
const a = chatStore.getChatByUuid(+uuid);
if (a.length > 20) {
a.splice(0, a.length - 20);
}
return a.map((item, index) => ({
...item,
key: `${item.dateTime}-${index}`,
}));
} catch (error) {
console.error("Error in computing dataSources:", error);
return []; // Return an empty array in case of an error
}
});
```