claim page done

This commit is contained in:
2025-07-28 17:49:01 +05:30
parent d9ce19df80
commit 0930b70bfd
7 changed files with 152 additions and 206 deletions

View File

@@ -24,7 +24,11 @@ const PatientSchema = (
});
type Patient = z.infer<typeof PatientSchema>;
export default function ClaimsOfPatientModal() {
interface ClaimsOfPatientModalProps {
onNewClaim?: (patientId: number) => void;
}
export default function ClaimsOfPatientModal({ onNewClaim }: ClaimsOfPatientModalProps) {
const [selectedPatient, setSelectedPatient] = useState<Patient | null>(null);
const [isModalOpen, setIsModalOpen] = useState(false);
const [claimsPage, setClaimsPage] = useState(1);
@@ -70,13 +74,18 @@ export default function ClaimsOfPatientModal() {
<CardHeader>
<CardTitle>Patient Records</CardTitle>
<CardDescription>
View and manage all patient information
Select any patient and View all their recent claims.
</CardDescription>
<CardDescription>
Also create new claim for any patients.
</CardDescription>
</CardHeader>
<CardContent>
<PatientTable
allowView
allowCheckbox
allowNewClaim
onNewClaim={onNewClaim}
onSelectPatient={handleSelectPatient}
/>
</CardContent>

View File

@@ -94,7 +94,6 @@ export default function ClaimsRecentTable({
patientId,
}: ClaimsRecentTableProps) {
const { toast } = useToast();
const { user } = useAuth();
const [isViewClaimOpen, setIsViewClaimOpen] = useState(false);
const [isEditClaimOpen, setIsEditClaimOpen] = useState(false);

View File

@@ -8,7 +8,7 @@ import {
TableRow,
} from "@/components/ui/table";
import { Button } from "@/components/ui/button";
import { Delete, Edit, Eye } from "lucide-react";
import { Delete, Edit, Eye, FileCheck } from "lucide-react";
import { Avatar, AvatarFallback } from "@/components/ui/avatar";
import {
Pagination,
@@ -69,6 +69,8 @@ interface PatientTableProps {
allowView?: boolean;
allowDelete?: boolean;
allowCheckbox?: boolean;
allowNewClaim?: boolean;
onNewClaim?: (patientId: number) => void;
onSelectPatient?: (patient: Patient | null) => void;
onPageChange?: (page: number) => void;
onSearchChange?: (searchTerm: string) => void;
@@ -79,6 +81,8 @@ export function PatientTable({
allowView,
allowDelete,
allowCheckbox,
allowNewClaim,
onNewClaim,
onSelectPatient,
onPageChange,
onSearchChange,
@@ -481,6 +485,17 @@ export function PatientTable({
<Edit className="h-4 w-4" />
</Button>
)}
{allowNewClaim && (
<Button
variant="ghost"
size="icon"
onClick={() => onNewClaim?.(patient.id)}
className="text-green-600 hover:text-green-800 hover:bg-green-50"
aria-label="New Claim"
>
<FileCheck className="h-5 w-5" />
</Button>
)}
{allowView && (
<Button
variant="ghost"