feat: add filter chip
This commit is contained in:
parent
7dea0dace0
commit
57c337e0a9
18
app/components/ui/filter-chip.tsx
Normal file
18
app/components/ui/filter-chip.tsx
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import type { ReactNode } from 'react';
|
||||||
|
import { Link } from 'react-router';
|
||||||
|
import { cn } from '~/lib/utils';
|
||||||
|
|
||||||
|
export function FilterChip({ to, selected, children }: { to: string; selected: boolean; children: ReactNode }) {
|
||||||
|
return (
|
||||||
|
<Link
|
||||||
|
to={to}
|
||||||
|
aria-current={selected ? 'page' : undefined}
|
||||||
|
className={cn(
|
||||||
|
'flex h-[30px] items-center rounded-full px-3 text-xs font-medium ring-1 ring-inset transition-colors',
|
||||||
|
selected ? 'bg-text-primary text-background ring-text-primary' : 'text-text-secondary ring-border-control hover:text-text-primary',
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</Link>
|
||||||
|
);
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user