Skip to content

Commit 2a6746f

Browse files
feat(Employee): implement employee details UI in Show component
1 parent 3242d18 commit 2a6746f

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ There are bugs and/or implementations that require some attention.
153153

154154
- Adjust user's home dashboard with better info.
155155
- Add dashboard's routes for manager.
156+
- Implement employee details UI.
156157

157158
## 🤝 Contributing
158159

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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

Comments
 (0)