import { Head } from '@inertiajs/react';
import { UserRoundPlus } from 'lucide-react';
import { InstallerForm } from '@/components/crm/installer-form';
import { PageHeader } from '@/components/crm/page-header';
import { create as installersCreate, index as installersIndex } from '@/routes/installers';
import type { InstallerFormOptions } from '@/types';

export default function InstallersCreate({
    options,
}: {
    options: InstallerFormOptions;
}) {
    return (
        <>
            <Head title="New installer" />

            <PageHeader
                eyebrow={
                    <>
                        <UserRoundPlus className="size-3.5 text-solar" />
                        <span>Installer register</span>
                    </>
                }
                title="New installer"
                description="A crew is only usable once the licences, accreditation and insurance on this page are current."
            />

            <InstallerForm options={options} />
        </>
    );
}

InstallersCreate.layout = {
    breadcrumbs: [
        { title: 'Installers', href: installersIndex() },
        { title: 'New installer', href: installersCreate() },
    ],
};
