{/* Card header with title and delete */}
{card.title}
{
const cols = columns.get();
const colIndex = cols.findIndex((c) =>
c.id === column.id
);
if (colIndex >= 0) {
columns.set(
cols.map((col, i) =>
i === colIndex
? {
...col,
cards: col.cards.filter((c) =>
c.id !== card.id
),
}
: col
),
);
}
}}
>
×
{/* Card description */}
{card.description && (
{card.description}
)}
{/* Move buttons */}
{
const cols = columns.get();
const fromIndex = cols.findIndex((c) =>
c.id === column.id
);
const toIndex = fromIndex - 1;
if (fromIndex > 0 && toIndex >= 0) {
const cardData = cols[fromIndex].cards.find(
(c) => c.id === card.id,
);
if (cardData) {
columns.set(
cols.map((col, i) => {
if (i === fromIndex) {
return {
...col,
cards: col.cards.filter(
(c) => c.id !== card.id,
),
};
}
if (i === toIndex) {
return {
...col,
cards: [...col.cards, cardData],
};
}
return col;
}),
);
}
}
}}
>
←
{
const cols = columns.get();
const fromIndex = cols.findIndex((c) =>
c.id === column.id
);
const toIndex = fromIndex + 1;
if (fromIndex >= 0 && toIndex < cols.length) {
const cardData = cols[fromIndex].cards.find(
(c) => c.id === card.id,
);
if (cardData) {
columns.set(
cols.map((col, i) => {
if (i === fromIndex) {
return {
...col,
cards: col.cards.filter(
(c) => c.id !== card.id,
),
};
}
if (i === toIndex) {
return {
...col,
cards: [...col.cards, cardData],
};
}
return col;
}),
);
}
}
}}
>
→
))}
{/* Empty state */}
{computed(() =>
column.cards.length === 0
? (
)
: null
)}