1- import { Button } from "@/components/ui/button" ;
2- import {
3- CardContent ,
4- Card
5- } from "@/components/ui/card" ;
1+ import { Card , CardContent } from "@/components/ui/card" ;
62import { Input } from "@/components/ui/input" ;
73import type { JobFile } from "@/types/jobs" ;
8- import { RefreshCcw , Search } from "lucide-react" ;
4+ import { Search } from "lucide-react" ;
95import type { Dispatch , SetStateAction } from "react" ;
6+ import type { JobsMeta } from "@/types/jobs" ;
7+ import type { ReactNode } from "react" ;
8+ import { Badge } from "@/components/ui/badge" ;
109
10+ import { BriefcaseBusiness , FileSpreadsheet } from "lucide-react" ;
1111interface JobsFiltersCardProps {
1212 search : string ;
1313 setSearch : Dispatch < SetStateAction < string > > ;
@@ -19,6 +19,8 @@ interface JobsFiltersCardProps {
1919 files : JobFile [ ] ;
2020 loading : boolean ;
2121 onRefresh : ( ) => void ;
22+ meta : JobsMeta ;
23+ actions ?: ReactNode ;
2224}
2325
2426export function JobsFiltersCard ( {
@@ -32,58 +34,67 @@ export function JobsFiltersCard({
3234 files,
3335 loading,
3436 onRefresh,
37+ meta,
38+ actions,
3539} : JobsFiltersCardProps ) {
3640 return (
3741 < Card className = "border-border/70 bg-card/85 backdrop-blur dark:bg-card/95" >
38- < CardContent className = "grid gap-3 pt-6 md:grid-cols-4" >
39- < div className = "relative md:col-span-2" >
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"
45- placeholder = "Buscar por titulo, empresa, local ou link"
46- />
42+ < CardContent className = "flex flex-col gap-3 pt-6" >
43+ { /* Campo de busca */ }
44+ < div className = "flex items-center gap-3" >
45+ < div className = "relative flex-1" >
46+ < Search className = "pointer-events-none absolute left-3 top-3 h-4 w-4 text-muted-foreground" />
47+ < Input
48+ value = { search }
49+ onChange = { ( event ) => setSearch ( event . target . value ) }
50+ className = "pl-9 w-full"
51+ placeholder = "Buscar por titulo, empresa, local ou link"
52+ />
53+ </ div >
54+ < div className = "flex items-center gap-2" > { actions } </ div >
4755 </ div >
4856
49- < select
50- 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"
51- value = { keywordFilter }
52- onChange = { ( event ) => setKeywordFilter ( event . target . value ) }
53- >
54- < option value = "all" > Todas as palavras-chave</ option >
55- { keywords . map ( ( keyword ) => (
56- < option key = { keyword } value = { keyword } >
57- { keyword }
58- </ option >
59- ) ) }
60- </ select >
61-
62- < div className = "flex gap-2" >
57+ { /* Seção de filtros */ }
58+ < div className = "flex items-center gap-2 flex" >
6359 < select
64- 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"
65- value = { selectedFile }
66- onChange = { ( event ) => setSelectedFile ( event . target . value ) }
60+ 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"
61+ value = { keywordFilter }
62+ onChange = { ( event ) => setKeywordFilter ( event . target . value ) }
6763 >
68- { files . map ( ( file ) => (
69- < option key = { file . file } value = { file . file } >
70- { file . file }
64+ < option value = "all" > Todas as palavras-chave</ option >
65+ { keywords . map ( ( keyword ) => (
66+ < option key = { keyword } value = { keyword } >
67+ { keyword }
7168 </ option >
7269 ) ) }
7370 </ select >
74- < Button
75- variant = "outline"
76- size = "sm"
77- onClick = { onRefresh }
78- disabled = { loading }
79- >
80- < RefreshCcw
81- className = { `h-4 w-4 ${ loading ? "animate-spin" : "" } ` }
82- />
83- </ Button >
71+
72+ < div >
73+ < select
74+ 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"
75+ value = { selectedFile }
76+ onChange = { ( event ) => setSelectedFile ( event . target . value ) }
77+ >
78+ { files . map ( ( file ) => (
79+ < option key = { file . file } value = { file . file } >
80+ { file . file }
81+ </ option >
82+ ) ) }
83+ </ select >
84+ </ div >
85+
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 >
8496 </ div >
8597 </ CardContent >
86- < Card className = "border-border/70 bg-card/85 backdrop-blur dark:bg-card/95" > </ Card >
8798 </ Card >
8899 ) ;
89100}
0 commit comments