import type { JSX } from "solid-js"; import { For, Show } from "solid-js"; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { IconDotsVertical } from "@/components/ui/icons"; import { useT } from "@/stores/preferences-context"; type TableRowAction = { label: string; icon: JSX.Element; onSelect: () => void; destructive?: boolean; disabled?: boolean; }; export function TableRowActions(props: { label: string; actions: TableRowAction[]; compact?: boolean; triggerLabel?: string }) { const t = useT(); const singleAction = () => props.actions.length === 1 ? props.actions[0] : undefined; const run = (action: TableRowAction) => { if (action.disabled) return; setTimeout(action.onSelect, 0); }; return (