Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
fetchAnalysisTaskStatus,
subscribeAnalysisTaskStream,
} from "@/lib/api/result";
import { fetchMockApplyJobPosting } from "@/lib/api/mockApplies";

const RESUME_ANALYSIS_LOADING_DURATION_MS = 316_000;
const ANALYSIS_POLL_INTERVAL_MS = 2_500;
Expand Down Expand Up @@ -60,6 +61,10 @@ export default function ResumeAnalysisLoadingPageClient({
const mockApplyId = Number(params.mockApplyId);
const isValidMockApplyId = Number.isInteger(mockApplyId) && mockApplyId > 0;
const [pollingRetryKey, setPollingRetryKey] = useState(0);
const [jobPostingHeader, setJobPostingHeader] = useState({
companyName: "",
jobTitle: "",
});
const [errorMessage, setErrorMessage] = useState(
isError
? `응답 대기 시간이 길어져 작업을 멈췄어요.\n소모된 크레딧이 복구됐어요.`
Expand Down Expand Up @@ -100,6 +105,38 @@ export default function ResumeAnalysisLoadingPageClient({
router.replace(`/mockApply/${mockApplyId}${jobPostingQuery}`);
}, [jobPostingId, mockApplyId, router]);

useEffect(() => {
if (!isValidMockApplyId) {
return;
}

let ignore = false;

const loadJobPostingHeader = async () => {
try {
const jobPosting = await fetchMockApplyJobPosting(mockApplyId);

if (!ignore) {
setJobPostingHeader({
companyName: jobPosting.companyName,
jobTitle:
jobPosting.jobTitle || jobPosting.detailClassificationName || "",
});
}
} catch (error) {
if (!ignore) {
console.error("채용 공고 정보를 불러오지 못했습니다.", error);
}
}
};

void loadJobPostingHeader();

return () => {
ignore = true;
};
}, [isValidMockApplyId, mockApplyId]);

useEffect(() => {
if (isError || !isValidMockApplyId) {
return;
Expand Down Expand Up @@ -282,6 +319,8 @@ export default function ResumeAnalysisLoadingPageClient({
durationMs={RESUME_ANALYSIS_LOADING_DURATION_MS}
onBack={moveBackToResume}
applicationLabel={applicationLabel}
companyName={jobPostingHeader.companyName}
jobTitle={jobPostingHeader.jobTitle}
/>

{errorMessage && (
Expand Down
11 changes: 10 additions & 1 deletion jobdri/src/components/mockApply/ResumeAnalysisLoading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ interface ResumeAnalysisLoadingProps {
onBack?: () => void;
onComplete?: () => void;
applicationLabel?: string;
companyName?: string;
jobTitle?: string;
isFailed?: boolean;
onErrorConfirm?: () => void;
}
Expand All @@ -34,6 +36,8 @@ export default function ResumeAnalysisLoading({
onBack,
onComplete,
applicationLabel,
companyName = "",
jobTitle = "",
isFailed = false,
}: ResumeAnalysisLoadingProps) {
const initialRemainingSeconds = Math.max(1, Math.ceil(durationMs / 1000));
Expand Down Expand Up @@ -102,7 +106,12 @@ export default function ResumeAnalysisLoading({

return (
<div className="relative flex h-dvh min-w-[1100px] flex-col overflow-hidden bg-fill-quaternary-default">
<Header currentStep={5} applicationLabel={applicationLabel} />
<Header
currentStep={5}
applicationLabel={applicationLabel}
companyName={companyName}
jobTitle={jobTitle}
/>

<div className="flex min-h-0 flex-1 items-start px-2 pb-2">
<section
Expand Down