diff --git a/src/pages/platforms/PlatformsPage.tsx b/src/pages/platforms/PlatformsPage.tsx index ac0caff..72219ed 100644 --- a/src/pages/platforms/PlatformsPage.tsx +++ b/src/pages/platforms/PlatformsPage.tsx @@ -68,6 +68,7 @@ export function PlatformsPage({ session }: { session: AuthSession }) { const [selectedMasterId, setSelectedMasterId] = useState(''); const [selectedAgentId, setSelectedAgentId] = useState(''); const [platformName, setPlatformName] = useState(''); + const [createError, setCreateError] = useState(null); const [agentsLoading, setAgentsLoading] = useState(false); const [agentsError, setAgentsError] = useState(null); const [registrationCode, setRegistrationCode] = useState(null); @@ -203,6 +204,7 @@ export function PlatformsPage({ session }: { session: AuthSession }) { }; const handleOpenCreateModal = () => { + setCreateError(null); setModalOpen(true); setSelectedAgentId(''); setAgents([]); @@ -222,6 +224,7 @@ export function PlatformsPage({ session }: { session: AuthSession }) { }; const handleCreatePlatform = async () => { + setCreateError(null); if (!selectedMasterId) return; if (!selectedAgentId) { setAgentsError('플랫폼에 연결할 에이전트를 선택해 주세요.'); @@ -244,7 +247,7 @@ export function PlatformsPage({ session }: { session: AuthSession }) { message: created?.name ?? masterPlatforms.find((platform) => platform.id === selectedMasterId)?.name, }); } catch (reason) { - setError(reason instanceof Error ? reason.message : '플랫폼을 등록하지 못했습니다.'); + setCreateError(reason instanceof Error ? reason.message : '플랫폼을 등록하지 못했습니다.'); } finally { setSaving(false); } @@ -674,6 +677,11 @@ export function PlatformsPage({ session }: { session: AuthSession }) { placeholder="예: F1Tenth #01" /> + {createError ? ( +

+ {createError} +

+ ) : null}