"use client"; import { useRouter } from "next/navigation"; import { useState } from "react"; import { FilterIcon, RotateCcwIcon } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Field, FieldGroup, FieldLabel } from "@/components/ui/field"; import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select"; const ALL = "all"; export function AuditLogFilters({ actors, initialActorId, }: { actors: Array<{ id: string; label: string }>; initialActorId?: string; }) { const router = useRouter(); const [actorId, setActorId] = useState(initialActorId ?? ALL); function applyFilters() { const query = new URLSearchParams(); if (actorId !== ALL) query.set("actor", actorId); const suffix = query.toString(); router.push(suffix ? `/admin/activity?${suffix}` : "/admin/activity"); } return ( ผู้ดูแล
); }