- Remove 75 orphaned files: bypass API (models, DTOs, repositories, base classes, SQL schema), screening (models, DTOs, repositories), and CodeGenerationResult DTO - Replace favicon with navy version - Rename app title from "S&P Data Platform" to "S&P Collector" - Fix vite base path to match Spring Boot context-path (/snp-collector) - Rewrite CLAUDE.md with accurate architecture documentation 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>
|
||
);
|
||
}
|