source: frontend/src/components/ConsultationTable.tsx@ 700e2f9

main
Last change on this file since 700e2f9 was 700e2f9, checked in by 186079 <matej.milevski@…>, 5 days ago

Init

  • Property mode set to 100644
File size: 1.9 KB
RevLine 
[700e2f9]1import { type Component, For } from "solid-js";
2import ConsultationRow from "@/components/ConsultationRow";
3import type { Consultation } from "@/api/consultation";
4
5interface ConsultationTableProps {
6 consultations: Consultation[];
7 onEdit: (consultation: Consultation) => void;
8 onDelete: (id: number) => void;
9 onTogglePayment: (consultation: Consultation) => void;
10 readOnly?: boolean;
11}
12
13const ConsultationTable: Component<ConsultationTableProps> = (props) => (
14 <div class="bg-white rounded-lg shadow overflow-hidden">
15 <table class="min-w-full divide-y divide-gray-200">
16 <thead class="bg-gray-50">
17 <tr>
18 <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
19 Date
20 </th>
21 <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
22 {props.readOnly ? "Therapist" : "Patient"}
23 </th>
24 <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
25 Price
26 </th>
27 <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
28 Payment Status
29 </th>
30 <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
31 {props.readOnly ? "Details" : "Actions"}
32 </th>
33 </tr>
34 </thead>
35 <tbody class="bg-white divide-y divide-gray-200">
36 <For each={props.consultations}>
37 {(consultation) => (
38 <ConsultationRow
39 consultation={consultation}
40 onEdit={props.onEdit}
41 onDelete={props.onDelete}
42 onTogglePayment={props.onTogglePayment}
43 readOnly={props.readOnly}
44 />
45 )}
46 </For>
47 </tbody>
48 </table>
49 </div>
50);
51
52export default ConsultationTable;
Note: See TracBrowser for help on using the repository browser.