44 lines
1.6 KiB
TypeScript
44 lines
1.6 KiB
TypeScript
'use client';
|
||
|
||
import { Copy, Forward, Loader2, Trash2, X } from 'lucide-react';
|
||
import { Button } from '@/components/ui/button';
|
||
|
||
interface ChatSelectionToolbarProps {
|
||
count: number;
|
||
deleting?: boolean;
|
||
onCancel: () => void;
|
||
onCopy: () => void;
|
||
onForward: () => void;
|
||
onDelete: () => void;
|
||
}
|
||
|
||
export function ChatSelectionToolbar({ count, deleting, onCancel, onCopy, onForward, onDelete }: ChatSelectionToolbarProps) {
|
||
return (
|
||
<div className="flex items-center gap-2 border-t border-[#dce3ec] bg-white px-4 py-3 shadow-[0_-8px_24px_rgba(31,36,48,0.08)] animate-in fade-in slide-in-from-bottom-2 duration-200">
|
||
<Button type="button" variant="ghost" size="icon" className="h-9 w-9 shrink-0 rounded-xl" onClick={onCancel}>
|
||
<X className="h-4 w-4" />
|
||
</Button>
|
||
<p className="min-w-0 flex-1 text-sm font-medium">{count} выбрано</p>
|
||
<Button type="button" variant="secondary" size="sm" className="rounded-xl" onClick={onCopy}>
|
||
<Copy className="mr-1 h-4 w-4" />
|
||
Копировать
|
||
</Button>
|
||
<Button type="button" variant="secondary" size="sm" className="rounded-xl" onClick={onForward}>
|
||
<Forward className="mr-1 h-4 w-4" />
|
||
Переслать
|
||
</Button>
|
||
<Button
|
||
type="button"
|
||
variant="secondary"
|
||
size="sm"
|
||
className="rounded-xl text-red-600 hover:text-red-700"
|
||
disabled={deleting}
|
||
onClick={onDelete}
|
||
>
|
||
{deleting ? <Loader2 className="mr-1 h-4 w-4 animate-spin" /> : <Trash2 className="mr-1 h-4 w-4" />}
|
||
Удалить
|
||
</Button>
|
||
</div>
|
||
);
|
||
}
|