Skip to content

Commit 0c251f9

Browse files
committed
chore: fix resource delete handler
1 parent 0a9212f commit 0c251f9

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

web/src/components/MemoEditor/ResourceListView.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,18 @@ const ResourceListView = (props: Props) => {
3636
<div className="w-full flex flex-row justify-start flex-wrap gap-2 mt-2">
3737
{resourceList.map((resource) => {
3838
return (
39-
<SortableItem
39+
<div
4040
key={resource.name}
41-
id={resource.name}
4241
className="max-w-full w-auto flex flex-row justify-start items-center flex-nowrap gap-x-1 bg-zinc-100 dark:bg-zinc-900 px-2 py-1 rounded hover:shadow-sm text-gray-500 dark:text-gray-400"
4342
>
44-
<ResourceIcon resource={resource} className="!w-4 !h-4 !opacity-100" />
45-
<span className="text-sm max-w-[8rem] truncate">{resource.filename}</span>
46-
<Icon.X
47-
className="w-4 h-auto cursor-pointer opacity-60 hover:opacity-100"
48-
onClick={() => handleDeleteResource(resource.name)}
49-
/>
50-
</SortableItem>
43+
<SortableItem id={resource.name} className="flex flex-row justify-start items-center gap-x-1">
44+
<ResourceIcon resource={resource} className="!w-4 !h-4 !opacity-100" />
45+
<span className="text-sm max-w-[8rem] truncate">{resource.filename}</span>
46+
</SortableItem>
47+
<button className="shrink-0" onClick={() => handleDeleteResource(resource.name)}>
48+
<Icon.X className="w-4 h-auto cursor-pointer opacity-60 hover:opacity-100" />
49+
</button>
50+
</div>
5151
);
5252
})}
5353
</div>

0 commit comments

Comments
 (0)