♻️ use the same clear filter text for clearing filters in the column filter buttons

This commit is contained in:
Fred KISSIE
2026-06-04 20:08:27 +02:00
parent feb8045643
commit db014e3446
2 changed files with 5 additions and 4 deletions

View File

@@ -17,6 +17,7 @@ import { CheckIcon, ChevronDownIcon, Funnel } from "lucide-react";
import { cn } from "@app/lib/cn";
import { dataTableFilterPopoverContentClassName } from "@app/lib/dataTableFilterPopover";
import { Badge } from "./ui/badge";
import { useTranslations } from "next-intl";
interface FilterOption {
value: string;
@@ -27,7 +28,6 @@ interface ColumnFilterButtonProps {
options: FilterOption[];
selectedValue?: string;
onValueChange: (value: string | undefined) => void;
placeholder?: string;
searchPlaceholder?: string;
emptyMessage?: string;
className?: string;
@@ -38,7 +38,6 @@ export function ColumnFilterButton({
options,
selectedValue,
onValueChange,
placeholder,
searchPlaceholder = "Search...",
emptyMessage = "No options found",
className,
@@ -50,6 +49,8 @@ export function ColumnFilterButton({
(option) => option.value === selectedValue
);
const t = useTranslations();
return (
<Popover open={open} onOpenChange={setOpen}>
<PopoverTrigger asChild>
@@ -94,7 +95,7 @@ export function ColumnFilterButton({
}}
className="text-muted-foreground"
>
Clear filter
{t("accessFilterClear")}
</CommandItem>
)}
{options.map((option) => (

View File

@@ -120,7 +120,7 @@ export function ColumnMultiFilterButton({
}}
className="text-muted-foreground"
>
{t("accessUsersRoleFilterClear")}
{t("accessFilterClear")}
</CommandItem>
)}
{options.map((option) => (