Skip to content

Commit c6c94dd

Browse files
feat(Show): add NoContract component for better handling of absent contracts
1 parent 6d9affd commit c6c94dd

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { Button } from '@/components/ui/button';
2+
import { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from '@/components/ui/empty';
3+
import { FileUserIcon } from 'lucide-react';
4+
5+
export default function NoContract() {
6+
return (
7+
<Empty className="border border-dashed">
8+
<EmptyHeader>
9+
<EmptyMedia variant="icon">
10+
<FileUserIcon aria-hidden />
11+
</EmptyMedia>
12+
<EmptyTitle>No Contract Found</EmptyTitle>
13+
<EmptyDescription>
14+
This employee does not have any contract assigned yet. Please add a contract to proceed.
15+
</EmptyDescription>
16+
</EmptyHeader>
17+
<EmptyContent>
18+
<Button size="sm">
19+
{/* TODO: Implement route link to create contract */}
20+
Add Contract
21+
</Button>
22+
</EmptyContent>
23+
</Empty>
24+
);
25+
}

resources/js/pages/employees/Show.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import ContractItemListItem from '@/components/helpers/contract-item-list-item';
22
import EmployeeAccountInfoItem from '@/components/helpers/employee-account-info-item';
33
import EmployeePersonalInfoItem from '@/components/helpers/employee-personal-info-item';
4+
import NoContract from '@/components/helpers/no-contract';
45
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
56
import { Badge } from '@/components/ui/badge';
67
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
@@ -105,7 +106,7 @@ export default function Show({ employee: data }: Readonly<{ employee: EmployeeIn
105106
))}
106107
</ul>
107108
) : (
108-
<p>No contracts available.</p>
109+
<NoContract />
109110
)}
110111
</TabsContent>
111112
</Tabs>

0 commit comments

Comments
 (0)