|
| 1 | +import { useInitials } from '@/hooks/use-initials'; |
| 2 | +import Layout from '@/layouts/app-layout'; |
| 3 | +import employee_info from '@/routes/employee_info'; |
| 4 | +import { BreadcrumbItem } from '@/types'; |
| 5 | +import { EmployeeInfoWithRelations } from '@/types/application/employee'; |
| 6 | +import { Head } from '@inertiajs/react'; |
| 7 | + |
| 8 | +export default function Show({ employee: data }: Readonly<{ employee: EmployeeInfoWithRelations }>) { |
| 9 | + const getInitials = useInitials(); |
| 10 | + const { user, contracts, ...rest } = data; |
| 11 | + |
| 12 | + const breadcrumbs: BreadcrumbItem[] = [ |
| 13 | + { |
| 14 | + title: 'Employees', |
| 15 | + href: employee_info.index().url, |
| 16 | + }, |
| 17 | + { |
| 18 | + title: `${rest.full_name}`, |
| 19 | + href: employee_info.show(data.id).url, |
| 20 | + }, |
| 21 | + ]; |
| 22 | + |
| 23 | + // TODO: Remove console logs after finishing page implementation |
| 24 | + console.group('Employee Details'); |
| 25 | + console.log('User Data:', user); |
| 26 | + console.log('Contracts:', contracts); |
| 27 | + console.log('Employee Info:', rest); |
| 28 | + console.groupEnd(); |
| 29 | + |
| 30 | + return ( |
| 31 | + <Layout breadcrumbs={breadcrumbs}> |
| 32 | + <Head title={rest.full_name} /> |
| 33 | + |
| 34 | + {/* TODO: Implement employee details UI */} |
| 35 | + <article className="container py-2"> |
| 36 | + <h2 className="text-lg font-semibold">Employee Details</h2> |
| 37 | + <pre>{JSON.stringify(data, null, 2)}</pre> |
| 38 | + </article> |
| 39 | + </Layout> |
| 40 | + ); |
| 41 | +} |
0 commit comments