22
33import React , { useState , useCallback , useEffect , useRef } from "react" ;
44import { CreateInterviewPayload , useCreateInterview } from "@/app/hooks/useCreateInterview" ;
5- import { Candidate , Job } from "@/app/types" ;
5+ import { Candidate , Interview , Job } from "@/app/types" ;
66import { getAllCandidatesForCompany } from "@/app/utils/fetchCandidatesByJobs" ;
77import { fetchJobs } from "@/app/utils/fetchJobs" ;
88import useFetchProfile from "@/app/hooks/useFetchProfile" ;
@@ -12,10 +12,14 @@ import { useCompany } from "@/app/context/CompanyContext";
1212interface InterviewFormModalProps {
1313 isOpen : boolean ;
1414 onClose : ( ) => void ;
15- onSave : ( data : any ) => Promise < void > ;
15+ onSave : ( data : Interview | CreateInterviewPayload ) => Promise < void > ;
1616 initialData : CreateInterviewPayload ;
1717 scheduledDate ?: string ;
1818}
19+ interface Company {
20+ company_id : string ;
21+ company_name : string ;
22+ }
1923
2024type CandidateWithJob = Candidate & {
2125 job ?: { id ?: number ; job_title ?: string } | number ;
@@ -141,7 +145,7 @@ export default function InterviewFormModal({
141145 setDebugInfo ( null ) ;
142146 } , [ ] ) ;
143147
144- const handleCompanySelect = useCallback ( ( company : any ) => {
148+ const handleCompanySelect = useCallback ( ( company : Company ) => {
145149 setSelectedCompany ( company ) ;
146150 } , [ setSelectedCompany ] ) ;
147151
@@ -288,7 +292,7 @@ export default function InterviewFormModal({
288292 onClose ( ) ;
289293 } , 1500 ) ;
290294 } catch ( error ) {
291- let errorMessage = "Failed to save interview." ;
295+ const errorMessage = "Failed to save interview." ;
292296 setError ( errorMessage ) ;
293297 } finally {
294298 setSaving ( false ) ;
0 commit comments