- ItemMasterDataManagement 컴포넌트 구조화 (tabs, dialogs, components 분리) - HierarchyTab 타입 에러 수정 (BOMItem section_id, updated_at 추가) - API 클라이언트 구현 (item-master.ts, 13개 엔드포인트) - ItemMasterContext 구현 (상태 관리 및 데이터 흐름) - 백엔드 요구사항 문서 작성 (CORS 설정, API 스펙 등) - SSR 호환성 수정 (navigator API typeof window 체크) - 미사용 변수 ESLint 에러 해결 - Context 리팩토링 (AuthContext, RootProvider 추가) - API 유틸리티 추가 (error-handler, logger, transformers) 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
38 lines
946 B
TypeScript
38 lines
946 B
TypeScript
// 에러 메시지 컴포넌트
|
|
// API 오류 메시지 일관된 UI로 표시
|
|
|
|
import React from 'react';
|
|
import { AlertCircle } from 'lucide-react';
|
|
import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert';
|
|
|
|
interface ErrorMessageProps {
|
|
title?: string;
|
|
message: string;
|
|
onRetry?: () => void;
|
|
className?: string;
|
|
}
|
|
|
|
export const ErrorMessage: React.FC<ErrorMessageProps> = ({
|
|
title = '오류 발생',
|
|
message,
|
|
onRetry,
|
|
className = ''
|
|
}) => {
|
|
return (
|
|
<Alert variant="destructive" className={className}>
|
|
<AlertCircle className="h-4 w-4" />
|
|
<AlertTitle>{title}</AlertTitle>
|
|
<AlertDescription className="mt-2">
|
|
<p>{message}</p>
|
|
{onRetry && (
|
|
<button
|
|
onClick={onRetry}
|
|
className="mt-2 text-sm underline hover:no-underline"
|
|
>
|
|
다시 시도
|
|
</button>
|
|
)}
|
|
</AlertDescription>
|
|
</Alert>
|
|
);
|
|
}; |