42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
import { useState } from 'react';
|
|
import { Button } from '@/components/ui/button';
|
|
import { Upload } from 'lucide-react';
|
|
import {
|
|
Tooltip,
|
|
TooltipContent,
|
|
TooltipProvider,
|
|
TooltipTrigger,
|
|
} from '@/components/ui/tooltip';
|
|
import { ImportTransactionsDrawer } from './import-transactions-drawer';
|
|
|
|
export function ImportTransactionsButton() {
|
|
const [drawerOpen, setDrawerOpen] = useState(false);
|
|
|
|
return (
|
|
<>
|
|
<TooltipProvider>
|
|
<Tooltip>
|
|
<TooltipTrigger asChild>
|
|
<Button
|
|
variant="ghost"
|
|
className="h-9"
|
|
onClick={() => setDrawerOpen(true)}
|
|
aria-label="Import transactions"
|
|
>
|
|
<Upload className="h-5 w-5" />
|
|
Import
|
|
</Button>
|
|
</TooltipTrigger>
|
|
<TooltipContent>Import transactions from CSV/Excel</TooltipContent>
|
|
</Tooltip>
|
|
</TooltipProvider>
|
|
|
|
<ImportTransactionsDrawer
|
|
open={drawerOpen}
|
|
onOpenChange={setDrawerOpen}
|
|
/>
|
|
</>
|
|
);
|
|
}
|
|
|