diff --git a/apps/web/src/components/dashboard/open/ApplicantsDialog.tsx b/apps/web/src/components/dashboard/open/ApplicantsDialog.tsx index 226d22ab..495a5a25 100644 --- a/apps/web/src/components/dashboard/open/ApplicantsDialog.tsx +++ b/apps/web/src/components/dashboard/open/ApplicantsDialog.tsx @@ -1,23 +1,24 @@ -import { DashboardApplicantsResponse } from '@repo/types'; - import Avatar from '@/components/common/Avatar'; import { Dialog } from '@/components/common/Dialog'; import Empty from '@/components/common/Empty'; +import { useApplicantsTicle } from '@/hooks/api/dashboard'; interface ApplicantsDialogProps { + ticleId: number; isOpen: boolean; onClose: () => void; - applicants: DashboardApplicantsResponse; } -function ApplicantsDialog({ isOpen, onClose, applicants }: ApplicantsDialogProps) { +function ApplicantsDialog({ ticleId, isOpen, onClose }: ApplicantsDialogProps) { + const { data: applicants } = useApplicantsTicle(ticleId.toString()); + return ( 신청자 목록
    - {applicants.length === 0 ? ( + {!applicants || applicants.length === 0 ? ( ) : ( applicants.map((applicant) => ( diff --git a/apps/web/src/components/dashboard/open/TicleInfoCard.tsx b/apps/web/src/components/dashboard/open/TicleInfoCard.tsx index 402fa6a8..d4eea11e 100644 --- a/apps/web/src/components/dashboard/open/TicleInfoCard.tsx +++ b/apps/web/src/components/dashboard/open/TicleInfoCard.tsx @@ -32,14 +32,11 @@ function TicleInfoCard({ ticleId, ticleTitle, startTime, endTime, status }: Ticl onClose: onAiSummaryDialogClose, } = useModal(); - const { data: applicantsData } = useApplicantsTicle(ticleId.toString()); const { mutate: ticleStartMutate } = useStartTicle(); const { dateStr, timeRangeStr } = formatDateTimeRange(startTime, endTime); const navigate = useNavigate(); - if (!applicantsData) return; - const handleTicleStart = (e: MouseEvent) => { e.preventDefault(); ticleStartMutate(ticleId.toString()); @@ -107,9 +104,9 @@ function TicleInfoCard({ ticleId, ticleTitle, startTime, endTime, status }: Ticl {isApplicantsDialogOpen && ( )} {isAiSummaryDialogOpen && (