- Spring Boot 3.2.1 + React 19 프로젝트 구조 - S&P Global Maritime API Bypass 및 Risk & Compliance Screening 기능 - 팀 워크플로우 v1.6.1 적용 (settings.json, hooks, workflow-version) - 프론트엔드 빌드 (Vite + TypeScript + Tailwind CSS) - 메인 카드 레이아웃 CSS Grid 전환 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
38 lines
1.0 KiB
TypeScript
38 lines
1.0 KiB
TypeScript
import type { Toast as ToastType } from '../hooks/useToast';
|
||
|
||
const TYPE_STYLES: Record<ToastType['type'], string> = {
|
||
success: 'bg-emerald-500',
|
||
error: 'bg-red-500',
|
||
warning: 'bg-amber-500',
|
||
info: 'bg-blue-500',
|
||
};
|
||
|
||
interface Props {
|
||
toasts: ToastType[];
|
||
onRemove: (id: number) => void;
|
||
}
|
||
|
||
export default function ToastContainer({ toasts, onRemove }: Props) {
|
||
if (toasts.length === 0) return null;
|
||
|
||
return (
|
||
<div className="fixed top-4 right-4 z-50 flex flex-col gap-2 max-w-sm">
|
||
{toasts.map((toast) => (
|
||
<div
|
||
key={toast.id}
|
||
className={`${TYPE_STYLES[toast.type]} text-white px-4 py-3 rounded-lg shadow-lg
|
||
flex items-center justify-between gap-3 animate-slide-in`}
|
||
>
|
||
<span className="text-sm">{toast.message}</span>
|
||
<button
|
||
onClick={() => onRemove(toast.id)}
|
||
className="text-white/80 hover:text-white text-lg leading-none"
|
||
>
|
||
×
|
||
</button>
|
||
</div>
|
||
))}
|
||
</div>
|
||
);
|
||
}
|