@@ -2,10 +2,12 @@ import { Badge } from "@/components/ui/badge";
22import { Card , CardContent } from "@/components/ui/card" ;
33import { Input } from "@/components/ui/input" ;
44import type { JobFile , JobsMeta } from "@/types/jobs" ;
5+ import { KeywordsModal } from "./KeywordsModal" ;
56import { Search } from "lucide-react" ;
6- import type { Dispatch , ReactNode , SetStateAction } from "react" ;
7+ import { useState , Dispatch , ReactNode , SetStateAction } from "react" ;
78
89import { BriefcaseBusiness , FileSpreadsheet } from "lucide-react" ;
10+ import { Button } from "./ui/button" ;
911interface JobsFiltersCardProps {
1012 search : string ;
1113 setSearch : Dispatch < SetStateAction < string > > ;
@@ -31,64 +33,72 @@ export function JobsFiltersCard({
3133 meta,
3234 actions,
3335} : JobsFiltersCardProps ) {
36+ const [ seeKeywordsModal , setSeeKeywordsModal ] = useState ( false ) ;
37+
3438 return (
35- < Card className = "border-border/70 bg-card/85 backdrop-blur dark:bg-card/95" >
36- < CardContent className = "flex flex-col gap-3 pt-6" >
37- { /* Campo de busca */ }
38- < div className = "flex items-center gap-3" >
39- < div className = "relative flex-1" >
40- < Search className = "pointer-events-none absolute left-3 top-3 h-4 w-4 text-muted-foreground" />
41- < Input
42- value = { search }
43- onChange = { ( event ) => setSearch ( event . target . value ) }
44- className = "pl-9 w-full"
45- placeholder = "Buscar por titulo, empresa, local ou link"
46- />
39+ < >
40+ < Card className = "border-border/70 bg-card/85 backdrop-blur dark:bg-card/95" >
41+ < CardContent className = "flex flex-col gap-3 pt-6" >
42+ { /* Campo de busca */ }
43+ < div className = "flex items-center gap-3" >
44+ < div className = "relative flex-1" >
45+ < Search className = "pointer-events-none absolute left-3 top-3 h-4 w-4 text-muted-foreground" />
46+ < Input
47+ value = { search }
48+ onChange = { ( event ) => setSearch ( event . target . value ) }
49+ className = "pl-9 w-full"
50+ placeholder = "Buscar por titulo, empresa, local ou link"
51+ />
52+ </ div >
53+ < div className = "flex items-center gap-2" > { actions } </ div >
4754 </ div >
48- < div className = "flex items-center gap-2" > { actions } </ div >
49- </ div >
50-
51- { /* Seção de filtros */ }
52- < div className = "flex items-center gap-2 flex" >
53- < select
54- className = "h-10 rounded-md border border-input bg-background px-3 text-sm focus:outline-none focus:ring-2 focus:ring-ring focus:border-ring"
55- value = { keywordFilter }
56- onChange = { ( event ) => setKeywordFilter ( event . target . value ) }
57- >
58- < option value = "all" > Todas as palavras-chave</ option >
59- { keywords . map ( ( keyword ) => (
60- < option key = { keyword } value = { keyword } >
61- { keyword }
62- </ option >
63- ) ) }
64- </ select >
6555
66- < div >
56+ { /* Seção de filtros */ }
57+ < div className = "flex items-center gap-2" >
6758 < select
68- className = "h-10 w-full rounded-md border border-input bg-background px-3 text-sm focus:outline-none focus:ring-2 focus:ring-ring focus:border-ring"
69- value = { selectedFile }
70- onChange = { ( event ) => setSelectedFile ( event . target . value ) }
59+ className = "h-10 rounded-md border border-input bg-background px-3 text-sm focus:outline-none focus:ring-2 focus:ring-ring focus:border-ring"
60+ value = { keywordFilter }
61+ onChange = { ( event ) => setKeywordFilter ( event . target . value ) }
7162 >
72- { files . map ( ( file ) => (
73- < option key = { file . file } value = { file . file } >
74- { file . file }
63+ < option value = "all" > Todas as palavras-chave</ option >
64+ { keywords . map ( ( keyword ) => (
65+ < option key = { keyword } value = { keyword } >
66+ { keyword }
7567 </ option >
7668 ) ) }
7769 </ select >
78- </ div >
7970
80- < div className = "flex items-center gap-2" >
81- < Badge variant = "secondary" className = "gap-1 text-xs" >
82- < FileSpreadsheet className = "h-3.5 w-3.5" />
83- { meta . file || "Sem arquivo" }
84- </ Badge >
85- < Badge className = "gap-1 text-xs" >
86- < BriefcaseBusiness className = "h-3.5 w-3.5" />
87- { meta . total } vagas
88- </ Badge >
71+ < div >
72+ < select
73+ className = "h-10 w-full rounded-md border border-input bg-background px-3 text-sm focus:outline-none focus:ring-2 focus:ring-ring focus:border-ring"
74+ value = { selectedFile }
75+ onChange = { ( event ) => setSelectedFile ( event . target . value ) }
76+ >
77+ { files . map ( ( file ) => (
78+ < option key = { file . file } value = { file . file } >
79+ { file . file }
80+ </ option >
81+ ) ) }
82+ </ select >
83+ </ div >
84+
85+ < div className = "flex justify-between w-full" >
86+ < div className = "flex items-center gap-2" >
87+ < Badge variant = "secondary" className = "gap-1 text-xs" >
88+ < FileSpreadsheet className = "h-3.5 w-3.5" />
89+ { meta . file || "Sem arquivo" }
90+ </ Badge >
91+ < Badge className = "gap-1 text-xs" >
92+ < BriefcaseBusiness className = "h-3.5 w-3.5" />
93+ { meta . total } vagas
94+ </ Badge >
95+ </ div >
96+ </ div >
97+ < Button variant = { "outline" } onClick = { ( ) => setSeeKeywordsModal ( true ) } > Keywords</ Button >
8998 </ div >
90- </ div >
91- </ CardContent >
92- </ Card >
99+ </ CardContent >
100+ </ Card >
101+ { seeKeywordsModal && < KeywordsModal onClose = { ( ) => setSeeKeywordsModal ( false ) } /> }
102+ </ >
93103 ) ;
94104}
0 commit comments