import { ChevronDown, GripVertical, Pencil, Trash2 } from "lucide-react"; import { cn } from "@/lib/utils"; import { t } from "@/i18n"; import { useItemDnd, useSectionDnd } from "@/board/dnd"; import { IconImg, ItemAnchor, StatusChip, hostOf } from "@/board/primitives"; import { WidgetContent } from "@/widgets"; import type { BoardViewProps, ItemViewProps, RendererViews, SectionViewProps, } from "@/renderers/types"; // Cards — uniform compact grid. Second renderer; proves the seam while the // code is small. Ported from mockups/a-vercel-mono.html. function BoardView({ children }: BoardViewProps) { return
{children}
; } function SectionView({ section, onToggle, onDelete, children }: SectionViewProps) { const dnd = useSectionDnd(section.id); return (
{!section.collapsed && children}
); } function ItemView({ item, sectionId, status, onEdit }: ItemViewProps) { const dnd = useItemDnd(sectionId, item.id); const host = item.urls[0] ? hostOf(item.urls[0].url) : ""; return ( {(open) => (
{item.name}
{host ?
{host}
: null}
{item.urls.length > 1 && ( {item.urls.length} )} {item.urls.length > 0 && }
)}
); } function WidgetView({ item, sectionId, onEdit }: ItemViewProps) { const dnd = useItemDnd(sectionId, item.id); return (
); } export const cards: RendererViews = { BoardView, SectionView, ItemView, WidgetView, itemsGridClass: "grid grid-cols-[repeat(auto-fill,minmax(200px,1fr))] gap-2.5", };