1- import { Button } from "@/components/ui/button " ;
1+ import { Badge } from "@/components/ui/badge " ;
22import { Card , CardContent } from "@/components/ui/card" ;
33import { Input } from "@/components/ui/input" ;
4- import type { JobFile } from "@/types/jobs" ;
5- import { RefreshCcw , Search } from "lucide-react" ;
6- import type { Dispatch , SetStateAction } from "react" ;
4+ import type { JobFile , JobsMeta } from "@/types/jobs" ;
5+ import { Search } from "lucide-react" ;
6+ import type { Dispatch , ReactNode , SetStateAction } from "react" ;
77
8+ import { BriefcaseBusiness , FileSpreadsheet } from "lucide-react" ;
89interface JobsFiltersCardProps {
910 search : string ;
1011 setSearch : Dispatch < SetStateAction < string > > ;
@@ -14,8 +15,8 @@ interface JobsFiltersCardProps {
1415 selectedFile : string ;
1516 setSelectedFile : Dispatch < SetStateAction < string > > ;
1617 files : JobFile [ ] ;
17- loading : boolean ;
18- onRefresh : ( ) => void ;
18+ meta : JobsMeta ;
19+ actions ?: ReactNode ;
1920}
2021
2122export function JobsFiltersCard ( {
@@ -27,50 +28,65 @@ export function JobsFiltersCard({
2728 selectedFile,
2829 setSelectedFile,
2930 files,
30- loading ,
31- onRefresh ,
31+ meta ,
32+ actions ,
3233} : JobsFiltersCardProps ) {
3334 return (
3435 < Card className = "border-border/70 bg-card/85 backdrop-blur dark:bg-card/95" >
35- < CardContent className = "grid gap-3 pt-6 md:grid-cols-4" >
36- < div className = "relative md:col-span-2" >
37- < Search className = "pointer-events-none absolute left-3 top-3 h-4 w-4 text-muted-foreground" />
38- < Input
39- value = { search }
40- onChange = { ( event ) => setSearch ( event . target . value ) }
41- className = "pl-9"
42- placeholder = "Buscar por titulo, empresa, local ou link"
43- />
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+ />
47+ </ div >
48+ < div className = "flex items-center gap-2" > { actions } </ div >
4449 </ div >
4550
46- < select
47- className = "h-10 w-full rounded-md border border-input bg-background px-3 text-sm"
48- value = { keywordFilter }
49- onChange = { ( event ) => setKeywordFilter ( event . target . value ) }
50- >
51- < option value = "all" > Todas as palavras-chave</ option >
52- { keywords . map ( ( keyword ) => (
53- < option key = { keyword } value = { keyword } >
54- { keyword }
55- </ option >
56- ) ) }
57- </ select >
58-
59- < div className = "flex gap-2" >
51+ { /* Seção de filtros */ }
52+ < div className = "flex items-center gap-2 flex" >
6053 < select
61- className = "h-10 w-full rounded-md border border-input bg-background px-3 text-sm"
62- value = { selectedFile }
63- onChange = { ( event ) => setSelectedFile ( event . target . value ) }
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 ) }
6457 >
65- { files . map ( ( file ) => (
66- < option key = { file . file } value = { file . file } >
67- { file . file }
58+ < option value = "all" > Todas as palavras-chave</ option >
59+ { keywords . map ( ( keyword ) => (
60+ < option key = { keyword } value = { keyword } >
61+ { keyword }
6862 </ option >
6963 ) ) }
7064 </ select >
71- < Button variant = "outline" size = "sm" onClick = { onRefresh } disabled = { loading } >
72- < RefreshCcw className = { `h-4 w-4 ${ loading ? "animate-spin" : "" } ` } />
73- </ Button >
65+
66+ < div >
67+ < 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 ) }
71+ >
72+ { files . map ( ( file ) => (
73+ < option key = { file . file } value = { file . file } >
74+ { file . file }
75+ </ option >
76+ ) ) }
77+ </ select >
78+ </ div >
79+
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 >
89+ </ div >
7490 </ div >
7591 </ CardContent >
7692 </ Card >
0 commit comments