Uecko_ERP/modules/customer-invoices/src/web/components/buttons/append-empty-row-button.tsx

24 lines
774 B
TypeScript
Raw Normal View History

2025-07-07 18:25:13 +00:00
import { Button } from "@repo/shadcn-ui/components";
import { t } from "i18next";
import { PlusCircleIcon } from "lucide-react";
import { JSX, forwardRef } from "react";
export interface AppendEmptyRowButtonProps extends React.ComponentProps<typeof Button> {
label?: string;
className?: string;
}
export const AppendEmptyRowButton = forwardRef<HTMLButtonElement, AppendEmptyRowButtonProps>(
(
{ label = t("common.append_empty_row"), className, ...props }: AppendEmptyRowButtonProps,
ref
): JSX.Element => (
<Button type='button' variant='outline' ref={ref} {...props}>
<PlusCircleIcon className={label ? "w-4 h-4 mr-2" : "w-4 h-4"} />
{label && <>{label}</>}
</Button>
)
);
AppendEmptyRowButton.displayName = "AppendEmptyRowButton";