Skip to content

Commit

Permalink
appointments table reason cell srolling added
Browse files Browse the repository at this point in the history
  • Loading branch information
sinanptm committed Oct 7, 2024
1 parent 551cf66 commit 34b5d61
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions client/components/view/table/DoctorAppointmentTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { ButtonV2 } from "@/components/button/ButtonV2";
import { format } from 'date-fns'
import { toast } from "@/components/ui/use-toast";
import { Badge } from "@/components/ui/badge";
import { ScrollArea } from "@/components/ui/scroll-area";


const columns = [
Expand Down Expand Up @@ -52,7 +53,7 @@ export default function AppointmentTable({ page }: Props) {
});
router.replace(`/doctor/appointments?page=1&status=${AppointmentStatus.PENDING}`);
}
}, [notAcceptedAppointments,router]);
}, [notAcceptedAppointments, router]);


const appointments = useMemo(() => data?.items || [], [data?.items]);
Expand Down Expand Up @@ -138,12 +139,18 @@ export default function AppointmentTable({ page }: Props) {
{format(new Date(appointment.appointmentDate!), "PPPP")}
</TableCell>
<TableCell>{appointment.appointmentType}</TableCell>
<TableCell>{appointment.reason}</TableCell>
<TableCell>
<ScrollArea
className={`max-h-16 overflow-y-auto ${appointment.reason?.length! > 30 ? "h-16" : ""}`}
>
{appointment.reason}
</ScrollArea>
</TableCell>
<TableCell>
<GetStatusBadge status={appointment.status!} />
</TableCell>
<TableCell>
<Badge variant={`${appointment.isPrescriptionAdded?"success":"warning"}`}>
<Badge variant={`${appointment.isPrescriptionAdded ? "success" : "warning"}`}>
{appointment.isPrescriptionAdded ? "Added" : "Not Added"}
</Badge>
</TableCell>
Expand Down

1 comment on commit 34b5d61

@vercel
Copy link

@vercel vercel bot commented on 34b5d61 Oct 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.