import { DotsHorizontalIcon } from "@heroicons/react/solid"; import React, { FC } from "react"; import { useLocale } from "@lib/hooks/useLocale"; import { SVGComponent } from "@lib/types/SVGComponent"; import Dropdown, { DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, } from "@components/ui/Dropdown"; import Button from "./Button"; export type ActionType = { id: string; icon: SVGComponent; label: string; disabled?: boolean; color?: "primary" | "secondary"; } & ({ href?: never; onClick: () => any } | { href: string; onClick?: never }); interface Props { actions: ActionType[]; } const TableActions: FC = ({ actions }) => { const { t } = useLocale(); return ( <>
{actions.map((action) => ( ))}
{actions.map((action) => ( ))}
); }; export default TableActions;