Реализованы задачи бэклога 1-5 (1я не до конца)
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
import { Calendar, FileText } from 'lucide-react';
|
||||
import { useNavigate } from 'react-router';
|
||||
|
||||
interface Notification {
|
||||
id: string;
|
||||
type: 'urgent' | 'reminder';
|
||||
icon: React.ReactNode;
|
||||
title: string;
|
||||
description: string;
|
||||
action: string;
|
||||
}
|
||||
|
||||
const notifications: Notification[] = [
|
||||
{
|
||||
id: '1',
|
||||
type: 'urgent',
|
||||
icon: <Calendar className="w-4 h-4" />,
|
||||
title: 'Продление патента через 14 дней',
|
||||
description: 'Не забудьте подать документы заранее',
|
||||
action: 'Подробнее'
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
type: 'reminder',
|
||||
icon: <FileText className="w-4 h-4" />,
|
||||
title: 'Проверьте статус РВП',
|
||||
description: 'Возможно, уже готово к получению',
|
||||
action: 'Проверить'
|
||||
}
|
||||
];
|
||||
|
||||
export function Notifications() {
|
||||
const navigate = useNavigate();
|
||||
|
||||
if (notifications.length === 0) return null;
|
||||
|
||||
return (
|
||||
<div className="px-4 py-3 space-y-2">
|
||||
{notifications.map((notification) => (
|
||||
<div
|
||||
key={notification.id}
|
||||
className="bg-primary/5 border border-primary/20 rounded-lg p-3 flex items-start gap-2.5"
|
||||
>
|
||||
<div className="flex items-center justify-center w-8 h-8 rounded-full bg-primary/10 text-primary flex-shrink-0 mt-0.5">
|
||||
{notification.icon}
|
||||
</div>
|
||||
<div className="flex-1 min-w-0">
|
||||
<h3 className="font-medium text-sm mb-0.5">{notification.title}</h3>
|
||||
<p className="text-xs text-muted-foreground leading-tight">{notification.description}</p>
|
||||
</div>
|
||||
<button
|
||||
onClick={() => navigate(`/notification/${notification.id}`)}
|
||||
className="text-xs text-primary font-medium flex-shrink-0 mt-1 hover:underline"
|
||||
>
|
||||
{notification.action}
|
||||
</button>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user