import styled from '@emotion/styled'; import { Link } from '@inertiajs/react'; import { route } from '@izzyjs/route/client'; import { FormEvent, ReactNode } from 'react'; import Button from '~/components/common/form/_button'; import Form from '~/components/common/form/_form'; import { appendCollectionId } from '~/lib/navigation'; import BaseLayout from './_base_layout'; const FormLayoutStyle = styled.div(({ theme }) => ({ height: 'fit-content', width: theme.media.mobile, maxWidth: '100%', marginTop: '10em', paddingInline: '1em', display: 'flex', gap: '0.75em', flexDirection: 'column', })); interface FormLayoutProps { title: string; children: ReactNode; canSubmit: boolean; handleSubmit: (event: FormEvent) => void; textSubmitButton?: string; disableHomeLink?: boolean; collectionId?: string; } const FormLayout = ({ title, children, canSubmit, handleSubmit, textSubmitButton = 'Confirm', disableHomeLink = false, collectionId, }: FormLayoutProps) => (

{title}

{children}
{!disableHomeLink && ( ← Back to home )}
); export default FormLayout;