580 lines
23 KiB
TypeScript
580 lines
23 KiB
TypeScript
'use client'
|
|
|
|
import {useEffect, useState, useCallback, useRef, useMemo} from 'react'
|
|
import AppPageTitle from '@/components/app-shell/AppPageTitle'
|
|
import {Button} from '@/components/ui/button'
|
|
import {Input} from '@/components/ui/input'
|
|
import {Label} from '@/components/ui/label'
|
|
import {RadioGroup, RadioGroupItem} from '@/components/ui/radio-group'
|
|
import {Checkbox} from '@/components/ui/checkbox'
|
|
import {Tabs, TabsContent, TabsList, TabsTrigger} from '@/components/ui/tabs'
|
|
import {KriMultiSelect, KriSingleSelect} from '@/components/common/KriAutoComplete'
|
|
import {useDialog} from '@/hooks/useDialog'
|
|
import ResultCodeDialog from '@/components/dialog/ResultCodeDialog'
|
|
import { useDebouncedValue, useMounted } from "@kri/common/hooks";
|
|
import { LoadingOverlayAdapter } from '@/components/app-shell/LoadingOverlayAdapter'
|
|
import {
|
|
ProjectInfo, ProjectUpdateRequest, ResultCode,
|
|
ProjectStatus, ResultCodeType, SurveyType
|
|
} from "@/types/project";
|
|
import {
|
|
PROJECT_STATUS_LABEL,
|
|
PROJECT_STATUS_ORDER,
|
|
SURVEY_TYPE_LABEL,
|
|
SURVEY_TYPE_ORDER,
|
|
} from "@/const/projectConst";
|
|
import type { MultiSelectOption } from "@/components/common/KriAutoComplete";
|
|
import {FW_TEAM} from "@/const/userConst";
|
|
import {useItrntUserList} from "@/hooks/useItrntUserList";
|
|
import {useSelectedProject} from "@/hooks/useSelectedProject";
|
|
import {useAuth} from "@/hooks/useAuth";
|
|
import {KriEditor} from "@/components/kri-editor";
|
|
import {useRouter} from "next/navigation";
|
|
import {
|
|
useProjectInfoQuery,
|
|
useResultCodesQuery,
|
|
useAssignedCmpnIdsQuery,
|
|
useUpdateProjectMutation,
|
|
useDeleteProjectMutation,
|
|
useUploadScenarioImageMutation, useKartProjectListQuery,
|
|
} from "@/query/project";
|
|
import { useCmpnListQuery } from "@/query/cmpn";
|
|
|
|
const defaultProjectInfo: ProjectInfo = {
|
|
prjctIdx: 0,
|
|
prjctCd: '',
|
|
prjctName: '',
|
|
itrntPrjctCd: '',
|
|
prjctStatus: ProjectStatus.WAITING,
|
|
ownerDept: '',
|
|
ownerFw: '',
|
|
surveyTy: SurveyType.NONE,
|
|
surveyPrjctCd: '',
|
|
surveyUrl: '',
|
|
surveyDashboardUrl: '',
|
|
ff: false,
|
|
useContactSenario: false,
|
|
contactSenario: '',
|
|
regUser: '',
|
|
regDt: '',
|
|
}
|
|
|
|
type ExternalTab = 'redirect' | 'api'
|
|
|
|
const baseUrl = 'https://kcont.kric.com'
|
|
const sidParam = 'sid=[$SID]'
|
|
|
|
const externalUrls = {
|
|
redirect: {
|
|
start: `${baseUrl}/redirect/start?${sidParam}`,
|
|
complete: `${baseUrl}/redirect/complete?${sidParam}`,
|
|
screen: `${baseUrl}/redirect/screen?${sidParam}`,
|
|
quota: `${baseUrl}/redirect/quota?${sidParam}`,
|
|
},
|
|
api: {
|
|
start: `${baseUrl}/api/external/start?${sidParam}`,
|
|
complete: `${baseUrl}/api/external/complete?${sidParam}`,
|
|
screen: `${baseUrl}/api/external/screen?${sidParam}`,
|
|
quota: `${baseUrl}/api/external/quota?${sidParam}`,
|
|
},
|
|
} as const
|
|
|
|
const internalSurvey = new Set([SurveyType.KON, SurveyType.KIWI]);
|
|
|
|
const ProjectInfoPage = () => {
|
|
const router = useRouter();
|
|
const mounted = useMounted();
|
|
const {selectedProject} = useSelectedProject();
|
|
const {isDialogOpen, showDialog, hideDialog} = useDialog();
|
|
const {users} = useItrntUserList();
|
|
const {auth} = useAuth();
|
|
|
|
const [projectInfo, setProjectInfo] = useState<ProjectInfo>(defaultProjectInfo);
|
|
const [surveyKeyword, setSurveyKeyword] = useState('');
|
|
const debouncedKeyword = useDebouncedValue(surveyKeyword, 500);
|
|
|
|
const [externalTab, setExternalTab] = useState<ExternalTab>('redirect')
|
|
const sessionTempUrlsRef = useRef<Set<string>>(new Set());
|
|
const initialProjectInfoRef = useRef<ProjectInfo | null>(null);
|
|
|
|
const userTeam = auth.user?.userTeam ?? "";
|
|
const prjctIdx = selectedProject?.prjctIdx ?? 0;
|
|
const enabled = mounted && prjctIdx > 0;
|
|
|
|
|
|
const surveyTy = projectInfo.surveyTy ?? SurveyType.NONE;
|
|
const isInternalSurvey = internalSurvey.has(surveyTy);
|
|
const isKiwi = surveyTy === SurveyType.KON ? 0 : surveyTy === SurveyType.KIWI ? 1 : 0;
|
|
|
|
// 조회 쿼리들
|
|
const projectInfoQuery = useProjectInfoQuery(prjctIdx, enabled);
|
|
const resultCodesQuery = useResultCodesQuery(prjctIdx, enabled);
|
|
const cmpnListQuery = useCmpnListQuery();
|
|
const assignedCmpnQuery = useAssignedCmpnIdsQuery(prjctIdx, enabled);
|
|
|
|
const kartEnabled =
|
|
mounted &&
|
|
!!projectInfo.itrntPrjctCd &&
|
|
!!userTeam &&
|
|
isInternalSurvey;
|
|
|
|
const kartProjectListQuery = useKartProjectListQuery({
|
|
itrntPrjctCd: projectInfo.itrntPrjctCd,
|
|
userTeam,
|
|
isKiwi,
|
|
keyword: debouncedKeyword,
|
|
enabled: kartEnabled,
|
|
});
|
|
|
|
const updateMutation = useUpdateProjectMutation(prjctIdx);
|
|
const deleteMutation = useDeleteProjectMutation(prjctIdx);
|
|
const uploadScenarioMutation = useUploadScenarioImageMutation(prjctIdx, projectInfo.prjctCd);
|
|
|
|
const [resultCodeArray, setResultCodeArray] = useState<ResultCode[]>([]);
|
|
const [assignCmpnIdArray, setAssignCmpnIdArray] = useState<string[]>([]);
|
|
const [changeResultCodeType, setChangeResultCodeType] = useState<ResultCodeType[]>([]);
|
|
|
|
const cmpnOptionArray: MultiSelectOption[] = useMemo(() => {
|
|
const arr = cmpnListQuery.data ?? [];
|
|
return arr.filter((cmpn) => !cmpn.ownCmpn).map((cmpn) => ({
|
|
value: cmpn.cmpnId,
|
|
label: cmpn.cmpnAlias || cmpn.cmpnId,
|
|
}));
|
|
}, [cmpnListQuery.data]);
|
|
|
|
|
|
const surveyProjectArray = kartProjectListQuery.data ?? [];
|
|
|
|
const deptArray = useMemo(() => {
|
|
const teams = Array.from(new Set((users ?? []).map((u) => u.userTeam).filter(Boolean)));
|
|
|
|
if (!teams.includes("T900")) teams.push("T900"); // TFT
|
|
|
|
return teams.sort((a, b) => a.localeCompare(b, "ko"));
|
|
}, [users]);
|
|
|
|
const fwArray: MultiSelectOption[] = useMemo(() => {
|
|
return (users ?? [])
|
|
.filter((u) => u.userId === projectInfo.ownerFw || u.userTeam === FW_TEAM)
|
|
.map((u) => ({value: u.userId, label: u.userNm}));
|
|
}, [users, projectInfo.ownerFw]);
|
|
|
|
const handleChange = (field: keyof ProjectInfo, value: any) => {
|
|
setProjectInfo((prev) => ({...prev, [field]: value}))
|
|
}
|
|
|
|
const handleImageUpload = useCallback(
|
|
async (file: File): Promise<string> => {
|
|
if (!projectInfo.prjctCd) {
|
|
alert("프로젝트 코드가 없습니다. 잠시 후 다시 시도해주세요.");
|
|
return "";
|
|
}
|
|
|
|
const url = await uploadScenarioMutation.mutateAsync(file);
|
|
sessionTempUrlsRef.current.add(url);
|
|
return url;
|
|
},
|
|
[uploadScenarioMutation, projectInfo.prjctCd]
|
|
);
|
|
|
|
const handleResultCodeClick = () => {
|
|
showDialog('resultCodeDialog')
|
|
}
|
|
|
|
const handleSubmit = async () => {
|
|
if (!projectInfo.prjctName) {
|
|
alert('프로젝트명을 입력해주세요.')
|
|
return
|
|
}
|
|
|
|
const updateCodeArray = structuredClone(
|
|
resultCodeArray.filter((rc) => changeResultCodeType.includes(rc.resultCdTy))
|
|
);
|
|
|
|
const requestUpdateProject: ProjectUpdateRequest = {
|
|
projectInfo: projectInfo,
|
|
resultCodeList: updateCodeArray,
|
|
assignCmpnIdList: assignCmpnIdArray,
|
|
}
|
|
|
|
await updateMutation.mutateAsync(requestUpdateProject);
|
|
initialProjectInfoRef.current = projectInfo;
|
|
alert("저장되었습니다.");
|
|
}
|
|
|
|
const handleDeleteClick = async () => {
|
|
if (!confirm("복구 할 수 없습니다. 정말 삭제 하시겠습니까?")) return;
|
|
if (!selectedProject) {
|
|
alert("옳지 않은 요청입니다.");
|
|
return;
|
|
}
|
|
|
|
await deleteMutation.mutateAsync();
|
|
router.push("/");
|
|
};
|
|
|
|
useEffect(() => {
|
|
if (projectInfoQuery.data) {
|
|
setProjectInfo(projectInfoQuery.data);
|
|
initialProjectInfoRef.current = projectInfoQuery.data;
|
|
}
|
|
}, [projectInfoQuery.data]);
|
|
|
|
useEffect(() => {
|
|
if (resultCodesQuery.data) {
|
|
setResultCodeArray(resultCodesQuery.data);
|
|
}
|
|
}, [resultCodesQuery.data]);
|
|
|
|
useEffect(() => {
|
|
if (assignedCmpnQuery.data) {
|
|
setAssignCmpnIdArray(assignedCmpnQuery.data);
|
|
}
|
|
}, [assignedCmpnQuery.data]);
|
|
|
|
useEffect(() => {
|
|
if (projectInfo.surveyTy !== SurveyType.EXTERNAL) {
|
|
setExternalTab('redirect')
|
|
}
|
|
}, [projectInfo.surveyTy]);
|
|
|
|
// KON/KIWI 프로젝트 "선택"을 사용자가 직접 바꿨을 때만 surveyUrl을 자동 생성한다.
|
|
// 저장된 프로젝트를 불러오는 경우(조회) 등에는 저장돼 있는 surveyUrl을 그대로 보여줘야 한다.
|
|
const handleSurveyPrjctCdChange = (value: string) => {
|
|
setProjectInfo((prev) => {
|
|
const next = {...prev, surveyPrjctCd: value};
|
|
|
|
if (value && internalSurvey.has(prev.surveyTy || SurveyType.NONE)) {
|
|
let surveyUrl = `/project/${value}/INDEX.asp?${sidParam}`;
|
|
if (prev.surveyTy === SurveyType.KON) {
|
|
surveyUrl = `https://kon.kric.com` + surveyUrl
|
|
} else if (prev.surveyTy === SurveyType.KIWI) {
|
|
surveyUrl = `https://kon.kiwisurvey.kr` + surveyUrl
|
|
}
|
|
|
|
next.surveyUrl = surveyUrl;
|
|
}
|
|
|
|
return next;
|
|
})
|
|
}
|
|
|
|
// 설문 연동(surveyTy)을 바꾸면 선택된 KON/KIWI 프로젝트, 설문 URL, 설문 대시보드 URL을 초기화한다.
|
|
// 단, 최초 조회 시점의 surveyTy로 다시 돌아오면 그때 저장돼 있던 값을 복원한다.
|
|
const handleSurveyTyChange = (value: string) => {
|
|
const nextSurveyTy = Number(value) as SurveyType;
|
|
const initial = initialProjectInfoRef.current;
|
|
const backToInitial = !!initial && initial.surveyTy === nextSurveyTy;
|
|
|
|
setProjectInfo((prev) => ({
|
|
...prev,
|
|
surveyTy: nextSurveyTy,
|
|
surveyPrjctCd: backToInitial ? (initial!.surveyPrjctCd ?? '') : '',
|
|
surveyUrl: backToInitial ? (initial!.surveyUrl ?? '') : '',
|
|
surveyDashboardUrl: backToInitial ? (initial!.surveyDashboardUrl ?? '') : '',
|
|
}))
|
|
}
|
|
|
|
if (!mounted) return <LoadingOverlayAdapter force />
|
|
|
|
return (
|
|
<div className="min-h-full">
|
|
<div className="space-y-6 pb-24 px-6">
|
|
<div className="max-w-[900px]">
|
|
<AppPageTitle titleText="프로젝트 정보" />
|
|
|
|
{/* 1. 기본 정보 */}
|
|
<div className="border rounded-lg p-6 space-y-5 bg-white mt-6">
|
|
<h3 className="text-xl font-semibold">프로젝트 기본 정보</h3>
|
|
<div className="space-y-4">
|
|
<div className="space-y-2">
|
|
<Label className="text-base">프로젝트 코드</Label>
|
|
<Input value={projectInfo.prjctCd || ''} disabled className="bg-gray-100 h-9" />
|
|
</div>
|
|
|
|
<div className="grid grid-cols-[1fr_auto] gap-3 items-end">
|
|
<div className="space-y-2">
|
|
<Label className="text-base">진행 상태</Label>
|
|
<RadioGroup
|
|
value={String(projectInfo.prjctStatus ?? ProjectStatus.WAITING)}
|
|
onValueChange={(v) => handleChange('prjctStatus', Number(v) as ProjectStatus)}
|
|
className="flex gap-4"
|
|
>
|
|
{PROJECT_STATUS_ORDER.map((s) => {
|
|
const id = `status-${s}`;
|
|
return (
|
|
<div key={s} className="flex items-center space-x-2">
|
|
<RadioGroupItem value={String(s)} id={id} />
|
|
<Label htmlFor={id} className="font-normal cursor-pointer text-base">
|
|
{PROJECT_STATUS_LABEL[s]}
|
|
</Label>
|
|
</div>
|
|
);
|
|
})}
|
|
</RadioGroup>
|
|
</div>
|
|
|
|
<Button onClick={handleResultCodeClick} className="h-9 text-base whitespace-nowrap">
|
|
결과 코드 설정
|
|
</Button>
|
|
</div>
|
|
|
|
<div className="space-y-2">
|
|
<Label className="text-base">
|
|
프로젝트 명<span className="text-red-500 ml-1">*</span>
|
|
</Label>
|
|
<Input
|
|
value={projectInfo.prjctName || ''}
|
|
onChange={(e) => handleChange('prjctName', e.target.value)}
|
|
placeholder="프로젝트명을 입력하세요"
|
|
className="h-9"
|
|
/>
|
|
</div>
|
|
|
|
<div className="grid grid-cols-2 gap-4">
|
|
<div className="space-y-2">
|
|
<Label className="text-base">담당 그룹</Label>
|
|
<KriSingleSelect
|
|
items={deptArray}
|
|
value={projectInfo.ownerDept || ''}
|
|
onChange={(value) => handleChange('ownerDept', value)}
|
|
placeholder="담당 그룹을 선택하세요"
|
|
heightClassName="h-9"
|
|
widthClassName="w-full"
|
|
/>
|
|
</div>
|
|
|
|
<div className="space-y-2">
|
|
<Label className="text-base">담당 실사</Label>
|
|
<KriSingleSelect
|
|
items={fwArray}
|
|
value={projectInfo.ownerFw || ''}
|
|
onChange={(value) => handleChange('ownerFw', value)}
|
|
getValue={(item) => item.value}
|
|
getLabel={(item) => item.label}
|
|
placeholder="담당 실사를 선택하세요"
|
|
heightClassName="h-9"
|
|
widthClassName="w-full"
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div className="border rounded-lg p-6 space-y-4 bg-white mt-3">
|
|
<h3 className="text-xl font-semibold">외주사</h3>
|
|
<KriMultiSelect
|
|
items={cmpnOptionArray}
|
|
value={assignCmpnIdArray}
|
|
onChange={(value) => setAssignCmpnIdArray(value)}
|
|
getValue={(item) => item.value}
|
|
getLabel={(item) => item.label}
|
|
maxCount={2}
|
|
placeholder="없음"
|
|
heightClassName="h-9"
|
|
widthClassName="w-full"
|
|
/>
|
|
</div>
|
|
|
|
<div className="border rounded-lg p-6 space-y-4 bg-white mt-3">
|
|
<h3 className="text-xl font-semibold">설문 연동</h3>
|
|
|
|
<RadioGroup
|
|
value={String(projectInfo.surveyTy ?? SurveyType.NONE)}
|
|
onValueChange={handleSurveyTyChange}
|
|
className="flex gap-4"
|
|
>
|
|
{SURVEY_TYPE_ORDER.map((t) => {
|
|
const id = `survey-${t}`; // 유니크 보장
|
|
return (
|
|
<div key={t} className="flex items-center space-x-2">
|
|
<RadioGroupItem value={String(t)} id={id} />
|
|
<Label htmlFor={id} className="font-normal cursor-pointer text-base">
|
|
{SURVEY_TYPE_LABEL[t]}
|
|
</Label>
|
|
</div>
|
|
);
|
|
})}
|
|
</RadioGroup>
|
|
|
|
{(projectInfo.surveyTy === SurveyType.KON || projectInfo.surveyTy === SurveyType.KIWI) && (
|
|
<div className="space-y-2">
|
|
<Label className="text-base">{SURVEY_TYPE_LABEL[projectInfo.surveyTy]} 프로젝트</Label>
|
|
<KriSingleSelect
|
|
items={surveyProjectArray}
|
|
value={projectInfo.surveyPrjctCd || ''}
|
|
onChange={handleSurveyPrjctCdChange}
|
|
getValue={(item) => item.pkey}
|
|
getLabel={(item) => `[${item.pkey}] ${item.title}`}
|
|
searchMode={"inputOnly"}
|
|
onSearchValueChange={setSurveyKeyword}
|
|
placeholder="프로젝트를 선택하세요"
|
|
heightClassName="h-9"
|
|
widthClassName="w-full"
|
|
/>
|
|
</div>
|
|
)}
|
|
{projectInfo.surveyTy !== SurveyType.NONE && (
|
|
<div className="space-y-2">
|
|
<Label className="text-base">설문 URL</Label>
|
|
<Input
|
|
value={projectInfo.surveyUrl || ''}
|
|
onChange={(e) => handleChange('surveyUrl', e.target.value)}
|
|
placeholder="https://"
|
|
className="h-9"
|
|
/>
|
|
</div>
|
|
)}
|
|
|
|
{projectInfo.surveyTy === SurveyType.EXTERNAL && (
|
|
<div className="space-y-2">
|
|
<Label className="text-base">설문 대시보드 URL</Label>
|
|
<Input
|
|
value={projectInfo.surveyDashboardUrl || ''}
|
|
onChange={(e) => handleChange('surveyDashboardUrl', e.target.value)}
|
|
placeholder="https://"
|
|
className="h-9"
|
|
/>
|
|
</div>
|
|
)}
|
|
|
|
{projectInfo.surveyTy === SurveyType.EXTERNAL && (
|
|
<div className="space-y-2">
|
|
<Tabs value={externalTab} onValueChange={(v) => setExternalTab(v as ExternalTab)} className="w-full">
|
|
<TabsList className="grid w-full grid-cols-2">
|
|
<TabsTrigger value="redirect">리다이렉트</TabsTrigger>
|
|
<TabsTrigger value="api">API</TabsTrigger>
|
|
</TabsList>
|
|
|
|
<TabsContent value="redirect" className="mt-4">
|
|
<div className="border rounded-lg p-4 space-y-3 bg-gray-50">
|
|
<div className="font-semibold">리다이렉트 URL</div>
|
|
|
|
<div className="grid gap-2">
|
|
<div className="flex items-center gap-2">
|
|
<Label className="w-24 text-base">시작:</Label>
|
|
<Input value={externalUrls.redirect.start} disabled className="bg-white h-9" />
|
|
</div>
|
|
<div className="flex items-center gap-2">
|
|
<Label className="w-24 text-base">완료:</Label>
|
|
<Input value={externalUrls.redirect.complete} disabled className="bg-white h-9" />
|
|
</div>
|
|
<div className="flex items-center gap-2">
|
|
<Label className="w-24 text-base">스크린 아웃:</Label>
|
|
<Input value={externalUrls.redirect.screen} disabled className="bg-white h-9" />
|
|
</div>
|
|
<div className="flex items-center gap-2">
|
|
<Label className="w-24 text-base">쿼터 풀:</Label>
|
|
<Input value={externalUrls.redirect.quota} disabled className="bg-white h-9" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</TabsContent>
|
|
|
|
<TabsContent value="api" className="mt-4">
|
|
<div className="border rounded-lg p-4 space-y-3 bg-gray-50">
|
|
<div className="font-semibold">API URL</div>
|
|
|
|
<div className="grid gap-2">
|
|
<div className="flex items-center gap-2">
|
|
<Label className="w-24 text-base">시작 API:</Label>
|
|
<Input value={externalUrls.api.start} disabled className="bg-white h-9" />
|
|
</div>
|
|
<div className="flex items-center gap-2">
|
|
<Label className="w-24 text-base">완료 API:</Label>
|
|
<Input value={externalUrls.api.complete} disabled className="bg-white h-9" />
|
|
</div>
|
|
<div className="flex items-center gap-2">
|
|
<Label className="w-24 text-base">스크린 API:</Label>
|
|
<Input value={externalUrls.api.screen} disabled className="bg-white h-9" />
|
|
</div>
|
|
<div className="flex items-center gap-2">
|
|
<Label className="w-24 text-base">쿼터 API:</Label>
|
|
<Input value={externalUrls.api.quota} disabled className="bg-white h-9" />
|
|
</div>
|
|
</div>
|
|
|
|
<p className="text-xs text-muted-foreground">API Method는 Post를 사용하시면 됩니다.</p>
|
|
</div>
|
|
</TabsContent>
|
|
</Tabs>
|
|
</div>
|
|
)}
|
|
</div>
|
|
|
|
<div className="border rounded-lg p-6 space-y-4 bg-white mt-3">
|
|
<h3 className="text-xl font-semibold">기타 옵션</h3>
|
|
|
|
<div className="space-y-4">
|
|
<div className="flex items-center space-x-2">
|
|
<Checkbox
|
|
id="ff"
|
|
checked={projectInfo.ff || false}
|
|
onCheckedChange={(checked) => handleChange('ff', checked === true)}
|
|
/>
|
|
<Label htmlFor="ff" className="font-normal cursor-pointer text-base">
|
|
현장 면접 진행
|
|
</Label>
|
|
</div>
|
|
|
|
<div className="flex items-center space-x-2">
|
|
<Checkbox
|
|
id="useContactSenario"
|
|
checked={projectInfo.useContactSenario || false}
|
|
onCheckedChange={(checked) => handleChange('useContactSenario', checked === true)}
|
|
/>
|
|
<Label htmlFor="useContactSenario" className="font-normal cursor-pointer text-base">
|
|
컨택 시나리오
|
|
</Label>
|
|
</div>
|
|
|
|
{projectInfo.useContactSenario && (
|
|
<div className="ml-6 border rounded p-4 bg-gray-50 text-sm text-gray-600">
|
|
<KriEditor
|
|
value={projectInfo.contactSenario ?? "<p></p>"}
|
|
onChange={(html: string) => handleChange("contactSenario", html)}
|
|
placeholder="컨택 시나리오를 작성해 주세요"
|
|
className="w-full"
|
|
debounceMs={600} // 기본 400ms, 원하면 늘리세요(예: 600~1000)
|
|
onImageUpload={async (file) => await handleImageUpload(file)} // 사용 시만
|
|
/>
|
|
</div>
|
|
)}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div className="fixed left-0 right-0 bottom-0 z-[20] border-t bg-white/80 backdrop-blur shadow-sm">
|
|
<div className="px-6 py-3">
|
|
<div className="max-w-[836px] ml-0">
|
|
<div className="flex justify-end gap-2">
|
|
<Button
|
|
variant="destructive"
|
|
className="w-32 h-10 text-base"
|
|
onClick={handleDeleteClick}
|
|
>
|
|
삭제
|
|
</Button>
|
|
<Button onClick={handleSubmit} className="w-32 h-10 text-base">
|
|
저장
|
|
</Button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<ResultCodeDialog
|
|
open={isDialogOpen('resultCodeDialog')}
|
|
onOpenChange={(open) => (open ? showDialog('resultCodeDialog') : hideDialog('resultCodeDialog'))}
|
|
changeCodeType={changeResultCodeType}
|
|
onChangeCodeType={setChangeResultCodeType}
|
|
sourceArray={resultCodeArray}
|
|
onSave={setResultCodeArray}
|
|
/>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default ProjectInfoPage
|