1- import { Button } from "@/components/ui/button" ;
21import { Card , CardContent } from "@/components/ui/card" ;
32import { Input } from "@/components/ui/input" ;
43import type { JobFile } from "@/types/jobs" ;
5- import { RefreshCcw , Search } from "lucide-react" ;
4+ import { Search } from "lucide-react" ;
65import 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" ;
79
10+ import { BriefcaseBusiness , FileSpreadsheet } from "lucide-react" ;
811interface JobsFiltersCardProps {
912 search : string ;
1013 setSearch : Dispatch < SetStateAction < string > > ;
@@ -16,6 +19,8 @@ interface JobsFiltersCardProps {
1619 files : JobFile [ ] ;
1720 loading : boolean ;
1821 onRefresh : ( ) => void ;
22+ meta : JobsMeta ;
23+ actions ?: ReactNode ;
1924}
2025
2126export function JobsFiltersCard ( {
@@ -29,48 +34,65 @@ export function JobsFiltersCard({
2934 files,
3035 loading,
3136 onRefresh,
37+ meta,
38+ actions,
3239} : JobsFiltersCardProps ) {
3340 return (
3441 < 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- />
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 >
4455 </ div >
4556
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" >
57+ { /* Seção de filtros */ }
58+ < div className = "flex items-center gap-2 flex" >
6059 < 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 ) }
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 ) }
6463 >
65- { files . map ( ( file ) => (
66- < option key = { file . file } value = { file . file } >
67- { file . file }
64+ < option value = "all" > Todas as palavras-chave</ option >
65+ { keywords . map ( ( keyword ) => (
66+ < option key = { keyword } value = { keyword } >
67+ { keyword }
6868 </ option >
6969 ) ) }
7070 </ select >
71- < Button variant = "outline" size = "sm" onClick = { onRefresh } disabled = { loading } >
72- < RefreshCcw className = { `h-4 w-4 ${ loading ? "animate-spin" : "" } ` } />
73- </ 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 >
7496 </ div >
7597 </ CardContent >
7698 </ Card >
0 commit comments