"use client"; import { useState } from "react"; import { Input, Modal, Toast } from "../../UI"; import { ArchivedDriverTable } from "./ArchivedDriverTable"; import { ArchivedDriverDetailModal } from "./ArchivedDriverDetailModal"; import { useArchivedDrivers } from "@/src/hooks/archive/useArchivedDrivers"; interface ArchivedDriversProps { onClose: () => void; } const searchIcon = ( ); /** * Top-level modal for browsing archived drivers. Wires the * useArchivedDrivers hook to the table and detail modal, mirroring * ArchivedUsersModal's structure and behavior for drivers. */ export function ArchivedDrivers({ onClose }: ArchivedDriversProps) { const [viewDriverId, setViewDriverId] = useState(null); const { drivers, loading, total, pages, notification, page, search, setPage, handleSearch, clearNotification, } = useArchivedDrivers(); return ( <> {viewDriverId && ( setViewDriverId(null)} /> )}
{/* search */}
handleSearch(e.target.value)} icon={searchIcon} dir="rtl" />
setViewDriverId(driver.id)} onPageChange={setPage} />
); }