mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 14:11:13 -05:00
feat: Implement comprehensive entity filtering
This commit is contained in:
@@ -5,8 +5,11 @@ import { Input } from '@/components/ui/input';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Dialog, DialogContent } from '@/components/ui/dialog';
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
||||
import { Collapsible, CollapsibleContent } from '@/components/ui/collapsible';
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { Search, SlidersHorizontal, Ruler, Plus } from 'lucide-react';
|
||||
import { Search, SlidersHorizontal, Ruler, Plus, ChevronDown, Filter } from 'lucide-react';
|
||||
import { DesignerFilters, DesignerFilterState, defaultDesignerFilters } from '@/components/designers/DesignerFilters';
|
||||
import { Company } from '@/types/database';
|
||||
import { supabase } from '@/integrations/supabase/client';
|
||||
import { DesignerCard } from '@/components/designers/DesignerCard';
|
||||
@@ -27,6 +30,8 @@ export default function Designers() {
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [searchQuery, setSearchQuery] = useState('');
|
||||
const [sortBy, setSortBy] = useState('name');
|
||||
const [filters, setFilters] = useState<DesignerFilterState>(defaultDesignerFilters);
|
||||
const [showFilters, setShowFilters] = useState(false);
|
||||
const [isCreateModalOpen, setIsCreateModalOpen] = useState(false);
|
||||
|
||||
const handleCreateSubmit = async (data: any) => {
|
||||
@@ -144,16 +149,33 @@ export default function Designers() {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Select value={sortBy} onValueChange={setSortBy}>
|
||||
<SelectTrigger className="w-full h-10">
|
||||
<SlidersHorizontal className="h-4 w-4 mr-2" />
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="name">Name A-Z</SelectItem>
|
||||
<SelectItem value="founded">Founded (Newest)</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<div className="flex gap-2">
|
||||
<Select value={sortBy} onValueChange={setSortBy}>
|
||||
<SelectTrigger className="w-[180px] h-10">
|
||||
<SlidersHorizontal className="h-4 w-4 mr-2" />
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="name">Name A-Z</SelectItem>
|
||||
<SelectItem value="founded">Founded (Newest)</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<Button variant="outline" onClick={() => setShowFilters(!showFilters)} className="gap-2">
|
||||
<Filter className="w-4 h-4" />
|
||||
Filters
|
||||
<ChevronDown className={`w-4 h-4 transition-transform ${showFilters ? 'rotate-180' : ''}`} />
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<Collapsible open={showFilters} onOpenChange={setShowFilters}>
|
||||
<CollapsibleContent>
|
||||
<Card className="mt-4">
|
||||
<CardContent className="pt-6">
|
||||
<DesignerFilters filters={filters} onFiltersChange={setFilters} designers={companies} />
|
||||
</CardContent>
|
||||
</Card>
|
||||
</CollapsibleContent>
|
||||
</Collapsible>
|
||||
</div>
|
||||
|
||||
{/* Companies Grid */}
|
||||
|
||||
Reference in New Issue
Block a user