add fixes

This commit is contained in:
smanylov
2025-12-19 13:05:50 +07:00
parent 35659a2878
commit c26c2ebc7f
5 changed files with 54 additions and 27 deletions
+5 -4
View File
@@ -5,6 +5,7 @@ interface DropDownListProps {
children: ReactNode;
value: string | number;
callBack: (value: string) => void;
translatedValue?: string;
}
interface ChildProps {
@@ -14,7 +15,7 @@ interface ChildProps {
children?: React.ReactNode;
}
export default function DropDownList({ children, value, callBack }: DropDownListProps) {
export default function DropDownList({ children, value, callBack, translatedValue }: DropDownListProps) {
const [isOpen, setIsOpen] = useState(false)
const dropdownRef = useRef<HTMLDivElement>(null)
useClickOutside(dropdownRef, () => {
@@ -30,8 +31,8 @@ export default function DropDownList({ children, value, callBack }: DropDownList
callBack(childValue || "");
setIsOpen(false);
},
className: `flex items-center w-full px-4 py-2 text-sm text-left hover:bg-blue-100 cursor-pointer select-none`,
key: index
className: `flex items-center w-full px-4 py-2 text-sm text-left hover:bg-blue-100 cursor-pointer select-none ${value === childValue ? "font-bold" : ""}`,
key: index,
});
}
return child;
@@ -47,7 +48,7 @@ export default function DropDownList({ children, value, callBack }: DropDownList
>
<span className="flex items-center">
<span className="mr-2">
{value}
{translatedValue ? translatedValue : value}
</span>
</span>
<svg