import { Head, Link } from '@inertiajs/react'; import { route } from '@izzyjs/route/client'; import { Anchor, Button, Container, Group, rem, Title } from '@mantine/core'; import { FormEvent, PropsWithChildren } from 'react'; import { useTranslation } from 'react-i18next'; import i18n from '~/i18n'; import { BaseLayout } from '~/layouts/_base_layout'; import { appendCollectionId } from '~/lib/navigation'; export interface FormLayoutProps extends PropsWithChildren { title: string; canSubmit: boolean; handleSubmit: (event: FormEvent) => void; textSubmitButton?: string; disableHomeLink?: boolean; submitBtnDanger?: boolean; collectionId?: number; } function FormLayout({ title, children, canSubmit, handleSubmit, textSubmitButton = i18n.t('common:form.confirm'), disableHomeLink = false, submitBtnDanger = false, collectionId, }: FormLayoutProps) { const { t } = useTranslation('common'); return (
{title} {children} {!disableHomeLink && ( {t('back-home')} )}
); } const LayoutWrapper = (props: FormLayoutProps) => ( ); export { LayoutWrapper as FormLayout };