Skip to content

Commit

Permalink
doctors page admin side added
Browse files Browse the repository at this point in the history
  • Loading branch information
sinanptm committed Aug 29, 2024
1 parent 6c206fb commit d5eb1e2
Show file tree
Hide file tree
Showing 14 changed files with 603 additions and 164 deletions.
143 changes: 134 additions & 9 deletions client/app/staff/doctors/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,134 @@
const page = () => {
return (
<main>
<h1 className="text-lg font-semibold md:text-2xl">Dashboard</h1>
</main>
);
};

export default page;
'use client'

import Image from "next/image";
import { ListFilter, MoreHorizontal, PlusCircle, Search } from "lucide-react";

import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card";
import {
DropdownMenu,
DropdownMenuCheckboxItem,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import {DoctorList} from '@/constants'



export default function DoctorsPage() {
return (
<main className="flex-1 space-y-4 p-4 md:p-6">
<div className="flex min-h-screen w-full flex-col bg-background">
<Tabs defaultValue="all" className="space-y-4">
<div className="flex items-center justify-between">
<TabsList>
<TabsTrigger value="all">All Doctors</TabsTrigger>
<TabsTrigger value="active">Active</TabsTrigger>
<TabsTrigger value="on-leave">On Leave</TabsTrigger>
<TabsTrigger value="inactive">Inactive</TabsTrigger>
</TabsList>
<div className="ml-auto flex items-center gap-2">
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="outline" size="sm" className="h-8">
<ListFilter className="mr-2 h-4 w-4" />
Filter
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end" className="w-[150px]">
<DropdownMenuLabel>Filter by</DropdownMenuLabel>
<DropdownMenuSeparator />
<DropdownMenuCheckboxItem checked>Active</DropdownMenuCheckboxItem>
<DropdownMenuCheckboxItem>On Leave</DropdownMenuCheckboxItem>
<DropdownMenuCheckboxItem>Inactive</DropdownMenuCheckboxItem>
</DropdownMenuContent>
</DropdownMenu>
<Button size="sm" className="h-8">
<PlusCircle className="mr-2 h-4 w-4" />
Add Doctor
</Button>
</div>
</div>
<TabsContent value="all" className="space-y-4">
<Card>
<CardHeader>
<CardTitle>All Doctors</CardTitle>
<CardDescription>
A list of all doctors including their status, specialty, and number of patients.
</CardDescription>
</CardHeader>
<CardContent>
<Table>
<TableHeader>
<TableRow>
<TableHead className="w-[80px]">Image</TableHead>
<TableHead>Name</TableHead>
<TableHead>Status</TableHead>
<TableHead>Specialty</TableHead>
<TableHead>Patients</TableHead>
<TableHead className="text-right">Actions</TableHead>
</TableRow>
</TableHeader>
<TableBody>
{DoctorList.map((doctor) => (
<TableRow key={doctor._id}>
<TableCell>
<Image
src={doctor.image}
alt={doctor.name}
width={64}
height={64}
className="rounded-full object-cover"
/>
</TableCell>
<TableCell className="font-medium">{doctor.name}</TableCell>
<TableCell>
<Badge
variant={"default"}
>
{doctor.status}
</Badge>
</TableCell>
<TableCell>{doctor.specialty}</TableCell>
<TableCell>{doctor.patients}</TableCell>
<TableCell className="text-right">
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="ghost" size="sm">
<MoreHorizontal className="h-4 w-4" />
<span className="sr-only">Open menu</span>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem>View Profile</DropdownMenuItem>
<DropdownMenuItem>Edit Details</DropdownMenuItem>
<DropdownMenuItem>Manage Schedule</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem className="text-destructive">Deactivate</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
</CardContent>
<CardFooter className="flex items-center justify-between">
<p className="text-sm text-muted-foreground">Showing 5 of 10 doctors</p>
<Button variant="outline" size="sm">
View All
</Button>
</CardFooter>
</Card>
</TabsContent>
</Tabs>
</div>
</main>
);
}
5 changes: 3 additions & 2 deletions client/app/staff/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React from "react";

const Dashboard = () => {
return (
<main className="">
<main className="">
<h1>Dashboard</h1>
<h2 className="text-5xl font-extrabold "> Dashboard</h2>
</main>
</main>
);
};

Expand Down
2 changes: 1 addition & 1 deletion client/app/staff/patients/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'

const page = () => {
return (
<div>page</div>
<h1 className='text-5xl font-extrabold '>page</h1>
)
}

Expand Down
2 changes: 1 addition & 1 deletion client/app/staff/products/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'

const ProductsPage = () => {
return (
<div>ProductsPage</div>
<h1 className='text-5xl font-extrabold '>ProductsPage</h1>
)
}

Expand Down
21 changes: 21 additions & 0 deletions client/components/common/ResponsieveCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import Image from 'next/image'
import React from 'react'

const ResponsiveCard = () => {
return (
<div className="max-w-md mx-auto bg-white rounded-xl shadow-md overflow-hidden md:max-w-2xl">
<div className="md:flex">
<div className="md:shrink-0">
<Image width={400} height={400} className="h-48 w-full object-cover md:h-full md:w-48" src="/img/building.jpg" alt="Modern building architecture" />
</div>
<div className="p-8">
<div className="uppercase tracking-wide text-sm text-indigo-500 font-semibold">Company retreats</div>
<a href="#" className="block mt-1 text-lg leading-tight font-medium text-black hover:underline">Incredible accommodation for your team</a>
<p className="mt-2 text-slate-500">Looking to take your team away on a retreat to enjoy awesome food and take in some sunshine? We have a list of places to do just that.</p>
</div>
</div>
</div>
)
}

export default ResponsiveCard
Loading

0 comments on commit d5eb1e2

Please sign in to comment.