import { ReactNode } from "react"; import { useTranslations } from "next-intl"; import { Button } from "../../shadcnui"; type CommonEditorButtonsProps = { isEdit: boolean; form: any; disabled?: boolean; setOpen: (open: boolean) => void; hideSubmit?: boolean; centerButtons?: ReactNode; buttonTitle?: string; }; export function CommonEditorButtons({ isEdit, form, disabled, setOpen, hideSubmit, centerButtons, buttonTitle, }: CommonEditorButtonsProps) { const t = useTranslations(); if (centerButtons) { return (
{centerButtons}
{!hideSubmit ? ( ) : (
)}
); } return (
{!hideSubmit && ( )}
); }