add fixes
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user