Merge 4bd23011ff419fb5e565f5305bb666e25483dac4 into fa1306916c652ea5f820d5b400087bece13460fd

This commit is contained in:
Teddi_r 2025-03-20 08:33:47 +07:00 committed by GitHub
commit a83d5504d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,9 +1,9 @@
'use client';
import { usePathname, useSearchParams } from 'next/navigation';
import { useEffect, useRef, useState } from 'react';
import { SVGProps, useEffect, useRef, useState } from 'react';
import { ChevronDownIcon } from '@heroicons/react/24/outline';
import { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/24/outline';
import type { ListItem } from '.';
import { FilterItem } from './item';
@ -36,6 +36,9 @@ export default function FilterItemDropdown({ list }: { list: ListItem[] }) {
});
}, [pathname, list, searchParams]);
const ChevronUpDownIcon = (props: SVGProps<SVGSVGElement>) =>
openSelect ? <ChevronUpIcon {...props} /> : <ChevronDownIcon {...props} />;
return (
<div className="relative" ref={ref}>
<div
@ -45,7 +48,7 @@ export default function FilterItemDropdown({ list }: { list: ListItem[] }) {
className="flex w-full items-center justify-between rounded-sm border border-black/30 px-4 py-2 text-sm dark:border-white/30"
>
<div>{active}</div>
<ChevronDownIcon className="h-4" />
<ChevronUpDownIcon className="h-4" />
</div>
{openSelect && (
<div