Files
Portfolio/src/components-vite/Alert.tsx
T
damjan_savicandClaude Opus 4.5 b1ec7b4d61 Migrate from Vite to Next.js 15 with SSR
- Replace Vite + React Router with Next.js 15 App Router
- Implement i18n with next-intl (URL-based: /de, /en, /sr)
- Add SSR/SSG for all pages (48 static pages generated)
- Setup Supabase SSR client for auth
- Migrate all pages: Home, About, Portfolio, Blog, Contact, Login, Dashboard, Imprint, Privacy, Terms
- Add Docker support with standalone output
- Replace i18next with next-intl JSON translations
- Use next/image for optimized images

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 01:00:33 +01:00

43 lines
1.3 KiB
TypeScript

// Alert.tsx
import React from 'react';
import { motion } from 'framer-motion';
import { CheckCircle2, XCircle } from 'lucide-react';
interface AlertProps {
variant?: 'success' | 'error';
children: React.ReactNode;
}
export const Alert: React.FC<AlertProps> = ({ variant = 'success', children }) => {
const variants = {
success: {
bg: 'bg-primary/10',
border: 'border-primary',
text: 'text-primary',
icon: <CheckCircle2 className="h-5 w-5" />
},
error: {
bg: 'bg-red-500/10',
border: 'border-red-500',
text: 'text-red-400',
icon: <XCircle className="h-5 w-5" />
}
};
const style = variants[variant];
return (
<motion.div
initial={{ opacity: 0, y: 10 }}
animate={{ opacity: 1, y: 0 }}
className={`${style.bg} ${style.border} ${style.text} border rounded-lg p-4 flex items-start space-x-3`}
>
<span className="flex-shrink-0">{style.icon}</span>
<div className="flex-1">{children}</div>
</motion.div>
);
};
export const AlertDescription: React.FC<{ children: React.ReactNode }> = ({ children }) => {
return <div className="text-sm">{children}</div>;
};