import { Link } from '@inertiajs/react'; import type { ReactNode } from 'react'; import { Button } from '@/components/ui/button'; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from '@/components/ui/tooltip'; export type RowAction = { label: string; icon: ReactNode; iconClassName?: string; show?: boolean; onClick?: () => void; href?: string; }; type RowActionsProps = { actions: RowAction[]; wrapperClassName?: string; }; export function RowActions({ actions, wrapperClassName = 'flex items-center justify-center gap-1', }: RowActionsProps) { return (
{actions .filter((action) => action.show !== false) .map((action) => ( {action.href ? ( ) : ( )} {action.label} ))}
); }