Files
aerbim-ht-monitor/frontend/components/ui/ExportMenu.tsx

54 lines
1.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
'use client'
import React, { useState } from 'react'
interface ExportMenuProps {
onExport: (format: 'csv' | 'pdf') => void
}
const ExportMenu: React.FC<ExportMenuProps> = ({ onExport }) => {
const [selectedFormat, setSelectedFormat] = useState<'csv' | 'pdf'>('csv')
const handleExport = () => {
onExport(selectedFormat)
}
return (
<div className="flex items-center gap-3 bg-[#161824] rounded-lg p-3 border border-gray-700">
<div className="flex items-center gap-2">
<label className="flex items-center gap-1">
<input
type="radio"
name="format"
value="csv"
checked={selectedFormat === 'csv'}
onChange={(e) => setSelectedFormat(e.target.value as 'csv' | 'pdf')}
className="w-3 h-3 text-blue-600"
/>
<span className="text-gray-300 text-sm">CSV</span>
</label>
<label className="flex items-center gap-1">
<input
type="radio"
name="format"
value="pdf"
checked={selectedFormat === 'pdf'}
onChange={(e) => setSelectedFormat(e.target.value as 'csv' | 'pdf')}
className="w-3 h-3 text-blue-600"
/>
<span className="text-gray-300 text-sm">PDF</span>
</label>
</div>
<button
onClick={handleExport}
className="px-3 py-1 bg-blue-600 hover:bg-blue-700 text-white text-sm rounded transition-colors"
>
Экспорт
</button>
</div>
)
}
export default ExportMenu