feat: remover componentes de filtro não utilizados no cabeçalho
parent
1cbb0eecdc
commit
d146dca016
|
|
@ -1,8 +1,20 @@
|
|||
import { Button } from '@/views/components/ui/button';
|
||||
import { Calendar } from '@/views/components/ui/calendar';
|
||||
import { Drawer, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger } from '@/views/components/ui/drawer';
|
||||
import { Popover, PopoverContent, PopoverTrigger } from '@/views/components/ui/popover';
|
||||
import { Funnel, GearSix } from '@phosphor-icons/react';
|
||||
import {
|
||||
Drawer,
|
||||
DrawerContent,
|
||||
DrawerDescription,
|
||||
DrawerFooter,
|
||||
DrawerHeader,
|
||||
DrawerTitle,
|
||||
DrawerTrigger,
|
||||
} from '@/views/components/ui/drawer';
|
||||
import {
|
||||
Popover,
|
||||
PopoverContent,
|
||||
PopoverTrigger,
|
||||
} from '@/views/components/ui/popover';
|
||||
import { GearSix } from '@phosphor-icons/react';
|
||||
import { ptBR } from 'date-fns/locale';
|
||||
import { useState } from 'react';
|
||||
|
||||
|
|
@ -15,37 +27,11 @@ import {
|
|||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from '@/views/components/ui/select';
|
||||
import {
|
||||
Sheet,
|
||||
SheetContent,
|
||||
SheetHeader,
|
||||
SheetTitle,
|
||||
SheetTrigger,
|
||||
} from '@/views/components/ui/sheet';
|
||||
import { SelectPopover } from './ui/select-popover';
|
||||
|
||||
import keyCarImg from '@/assets/images/car-keys.png';
|
||||
|
||||
type DateRange = RDateRange;
|
||||
|
||||
const projects = [
|
||||
{ id: 1, descricao: 'Projeto Alfa' },
|
||||
{ id: 2, descricao: 'Projeto Beta' },
|
||||
{ id: 3, descricao: 'Projeto Gama' },
|
||||
];
|
||||
|
||||
const sectors = [
|
||||
{ id: 1, descricao: 'Manutenção' },
|
||||
{ id: 2, descricao: 'Operações' },
|
||||
{ id: 3, descricao: 'Logística' },
|
||||
];
|
||||
|
||||
const clients = [
|
||||
{ id: 1, descricao: 'Cliente A' },
|
||||
{ id: 2, descricao: 'Cliente B' },
|
||||
{ id: 3, descricao: 'Cliente C' },
|
||||
];
|
||||
|
||||
export function Header() {
|
||||
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
|
||||
const [localDateRange, setLocalDateRange] = useState<DateRange | undefined>();
|
||||
|
|
@ -55,16 +41,6 @@ export function Header() {
|
|||
to: new Date(),
|
||||
}));
|
||||
|
||||
const [projectValue, setProjectValue] = useState<string>(
|
||||
projects[0]?.descricao ?? '',
|
||||
);
|
||||
const [sectorValue, setSectorValue] = useState<string>(
|
||||
sectors[0]?.descricao ?? '',
|
||||
);
|
||||
const [clientValue, setClientValue] = useState<string>(
|
||||
clients[0]?.descricao ?? '',
|
||||
);
|
||||
|
||||
function handlePopoverOpenChange(open: boolean) {
|
||||
setIsPopoverOpen(open);
|
||||
if (open) {
|
||||
|
|
@ -229,48 +205,6 @@ export function Header() {
|
|||
</PopoverContent>
|
||||
</Popover>
|
||||
</div>
|
||||
|
||||
<Sheet>
|
||||
<SheetTrigger asChild>
|
||||
<Button
|
||||
title="Clique para visualizar os filtros"
|
||||
variant="outline"
|
||||
size="icon">
|
||||
<Funnel size={18} />
|
||||
</Button>
|
||||
</SheetTrigger>
|
||||
<SheetContent className="w-fit space-y-4">
|
||||
<SheetHeader>
|
||||
<SheetTitle className="mt-1.5">Filtros</SheetTitle>
|
||||
</SheetHeader>
|
||||
|
||||
<div className="flex flex-col gap-3 w-[204px]">
|
||||
<SelectPopover
|
||||
label="Projeto"
|
||||
items={projects || []}
|
||||
value={projectValue}
|
||||
setValue={setProjectValue}
|
||||
placeholder="Selecione um projeto..."
|
||||
/>
|
||||
|
||||
<SelectPopover
|
||||
label="Setor"
|
||||
items={sectors || []}
|
||||
value={sectorValue}
|
||||
setValue={setSectorValue}
|
||||
placeholder="Selecione um setor..."
|
||||
/>
|
||||
|
||||
<SelectPopover
|
||||
label="Cliente"
|
||||
items={clients || []}
|
||||
value={clientValue}
|
||||
setValue={setClientValue}
|
||||
placeholder="Selecione um cliente..."
|
||||
/>
|
||||
</div>
|
||||
</SheetContent>
|
||||
</Sheet>
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue