fix: corrigido filtros por status (Pré-venda/Finalizada) no Dashboard.
This commit is contained in:
parent
9906db8bc6
commit
8730a8f5a3
1 changed files with 35 additions and 2 deletions
|
|
@ -7,6 +7,7 @@ export interface EventFilters {
|
||||||
type: string;
|
type: string;
|
||||||
company: string;
|
company: string;
|
||||||
institution: string;
|
institution: string;
|
||||||
|
fotStatus?: string; // New field
|
||||||
}
|
}
|
||||||
|
|
||||||
interface EventFiltersBarProps {
|
interface EventFiltersBarProps {
|
||||||
|
|
@ -31,6 +32,7 @@ export const EventFiltersBar: React.FC<EventFiltersBarProps> = ({
|
||||||
type: "",
|
type: "",
|
||||||
company: "",
|
company: "",
|
||||||
institution: "",
|
institution: "",
|
||||||
|
fotStatus: "",
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -54,7 +56,7 @@ export const EventFiltersBar: React.FC<EventFiltersBarProps> = ({
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5 gap-3">
|
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6 gap-3">
|
||||||
{/* Filtro por FOT */}
|
{/* Filtro por FOT */}
|
||||||
<div className="flex flex-col">
|
<div className="flex flex-col">
|
||||||
<label className="text-xs font-medium text-gray-600 mb-1 flex items-center gap-1">
|
<label className="text-xs font-medium text-gray-600 mb-1 flex items-center gap-1">
|
||||||
|
|
@ -90,6 +92,26 @@ export const EventFiltersBar: React.FC<EventFiltersBarProps> = ({
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* Filtro por Status da Turma */}
|
||||||
|
<div className="flex flex-col">
|
||||||
|
<label className="text-xs font-medium text-gray-600 mb-1 flex items-center gap-1">
|
||||||
|
<Filter size={14} className="text-brand-gold" />
|
||||||
|
Status da Turma
|
||||||
|
</label>
|
||||||
|
<select
|
||||||
|
value={filters.fotStatus || ""}
|
||||||
|
onChange={(e) =>
|
||||||
|
onFilterChange({ ...filters, fotStatus: e.target.value })
|
||||||
|
}
|
||||||
|
className="px-3 py-2 border border-gray-300 rounded text-sm focus:outline-none focus:border-brand-gold transition-colors bg-white"
|
||||||
|
>
|
||||||
|
<option value="">Todos</option>
|
||||||
|
<option value="normal">Normal</option>
|
||||||
|
<option value="pre_venda">Pré-Venda</option>
|
||||||
|
<option value="finalizada">Finalizada</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* Filtro por Tipo */}
|
{/* Filtro por Tipo */}
|
||||||
<div className="flex flex-col">
|
<div className="flex flex-col">
|
||||||
<label className="text-xs font-medium text-gray-600 mb-1 flex items-center gap-1">
|
<label className="text-xs font-medium text-gray-600 mb-1 flex items-center gap-1">
|
||||||
|
|
@ -209,7 +231,7 @@ export const EventFiltersBar: React.FC<EventFiltersBarProps> = ({
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
{filters.institution && (
|
{filters.institution && (
|
||||||
<span className="inline-flex items-center gap-1 px-2 py-1 bg-brand-gold/10 text-brand-gold text-xs rounded">
|
<span className="inline-flex items-center gap-1 px-2 py-1 bg-brand-gold/10 text-brand-gold text-xs rounded">
|
||||||
Inst: {filters.institution}
|
Inst: {filters.institution}
|
||||||
<button
|
<button
|
||||||
|
|
@ -220,6 +242,17 @@ export const EventFiltersBar: React.FC<EventFiltersBarProps> = ({
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
|
{filters.fotStatus && (
|
||||||
|
<span className="inline-flex items-center gap-1 px-2 py-1 bg-brand-gold/10 text-brand-gold text-xs rounded">
|
||||||
|
Status: {filters.fotStatus === 'pre_venda' ? 'Pré-Venda' : filters.fotStatus === 'finalizada' ? 'Finalizada' : 'Normal'}
|
||||||
|
<button
|
||||||
|
onClick={() => onFilterChange({ ...filters, fotStatus: "" })}
|
||||||
|
className="hover:text-brand-black"
|
||||||
|
>
|
||||||
|
<X size={12} />
|
||||||
|
</button>
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue