import FormShell from "@/components/app/FormShell"
import PageHeader from "@/components/app/PageHeader"
import PageShell from "@/components/app/PageShell"
import { Button } from "@/components/ui/button"
import EmployeeForm from "@/features/employees/components/EmployeeForm"
import { listBranches, listLeaveTypes, listShifts } from "@/features/employees/service"
import { getCountryConfig } from "@/lib/shared/country"

export default async function CreateEmployeePage() {
  const [branches, shifts, leaveTypes, countryConfig] = await Promise.all([
    listBranches(),
    listShifts(),
    listLeaveTypes(),
    getCountryConfig(),
  ])

  return (
    <PageShell>
      <PageHeader
        title="Add Employee"
        actions={
          <Button asChild variant="secondary">
            <a href="/employees">Back</a>
          </Button>
        }
      />
      <FormShell>
        <EmployeeForm
          branches={branches}
          shifts={shifts}
          leaveTypes={leaveTypes}
          hasUserAccount={false}
          currencyCode={countryConfig.currencyCode}
          decimalPlaces={countryConfig.decimalPlaces}
        />
      </FormShell>
    </PageShell>
  )
}