import { Clock, ArrowLeft, Bell, AlertCircle, Calendar, MessageCircle, Tag, Smartphone, Paperclip, CheckCircle2, RefreshCw, CreditCard } from 'lucide-react';
import { useNavigate } from 'react-router';
import { getActiveMessages, CompanyMessage } from '../data/companyMessages';
function getIcon(type: CompanyMessage['type']) {
if (type === 'urgent') return ;
if (type === 'reminder') return ;
if (type === 'message') return ;
if (type === 'promo') return ;
if (type === 'install') return ;
if (type === 'docs_required') return ;
if (type === 'docs_ready') return ;
if (type === 'status_changed') return ;
if (type === 'payment_pending') return ;
return ;
}
function typeColors(type: CompanyMessage['type']) {
if (type === 'urgent') return { icon: 'bg-destructive/12 text-destructive', dot: 'bg-destructive' };
if (type === 'reminder') return { icon: 'bg-primary/10 text-primary', dot: 'bg-primary' };
if (type === 'message') return { icon: 'bg-[#c8e6c9] text-[#2e7d32]', dot: 'bg-[#43a047]' };
if (type === 'promo') return { icon: 'bg-[#fff3cd] text-[#e65100]', dot: 'bg-[#fb8c00]' };
if (type === 'install') return { icon: 'bg-[#d1c4e9] text-[#4527a0]', dot: 'bg-[#7c4dff]' };
if (type === 'docs_required') return { icon: 'bg-[#ffe0b2] text-[#e65100]', dot: 'bg-[#fb8c00]' };
if (type === 'docs_ready') return { icon: 'bg-[#c8e6c9] text-[#2e7d32]', dot: 'bg-[#43a047]' };
if (type === 'status_changed') return { icon: 'bg-primary/10 text-primary', dot: 'bg-primary' };
if (type === 'payment_pending') return { icon: 'bg-[#f8bbd0] text-[#880e4f]', dot: 'bg-[#e91e63]' };
return { icon: 'bg-muted text-muted-foreground', dot: 'bg-muted-foreground' };
}
export function History() {
const navigate = useNavigate();
const messages = getActiveMessages();
return (
{/* Заголовок страницы */}
Центр уведомлений
{messages.length > 0 && (
{messages.length}
)}
{/* Список уведомлений */}
{messages.length > 0 ? (
{messages.map(msg => {
const colors = typeColors(msg.type);
return (
);
})}
) : (
Всё актуально
Новых уведомлений нет
)}
);
}