import type { Collection } from "@markone/core" import { Link } from "@tanstack/react-router" import { clsx } from "clsx" import { memo } from "react" import { Button } from "~/components/button" import { List } from "~/components/list" export enum CollectionListItemAction { Delete = "Delete", Edit = "Edit", } interface CollectionListProps { collections: Collection[] className?: string onItemAction: (collection: Collection, action: CollectionListItemAction) => void } const CollectionListItem = memo( ({ collection, isSelected, isExpanded, onSelect, onExpand, onItemAction, }: { collection: Collection isSelected: boolean isExpanded: boolean onSelect: () => void onExpand: () => void onItemAction: (collection: Collection, action: CollectionListItemAction) => void }) => (
{collection.name}

{collection.description}

{isExpanded ? (
 
) : null}
), ) function CollectionList({ collections, className, onItemAction }: CollectionListProps) { return ( ( )} /> ) } export { CollectionList }