import { useState } from "react"; import ClaimsRecentTable from "./claims-recent-table"; import { PatientTable } from "../patients/patient-table"; import { PatientUncheckedCreateInputObjectSchema } from "@repo/db/usedSchemas"; import { z } from "zod"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "../ui/card"; const PatientSchema = ( PatientUncheckedCreateInputObjectSchema as unknown as z.ZodObject ).omit({ appointments: true, }); type Patient = z.infer; interface ClaimsOfPatientModalProps { onNewClaim?: (patientId: number) => void; } export default function ClaimsOfPatientModal({ onNewClaim }: ClaimsOfPatientModalProps) { const [selectedPatient, setSelectedPatient] = useState(null); const [isModalOpen, setIsModalOpen] = useState(false); const [claimsPage, setClaimsPage] = useState(1); const handleSelectPatient = (patient: Patient | null) => { if (patient) { setSelectedPatient(patient); setClaimsPage(1); setIsModalOpen(true); } else { setSelectedPatient(null); setIsModalOpen(false); } }; return (
{/* Claims Section */} {selectedPatient && ( Claims for {selectedPatient.firstName} {selectedPatient.lastName} Displaying recent claims for the selected patient. )} {/* Patients Section */} Patient Records Select any patient and View all their recent claims. Also create new claim for any patients.
); }