REFACTOR code to use Optional entity

This commit is contained in:
2025-08-12 15:39:06 +02:00
parent 19a78df4c6
commit 6433294ced
7 changed files with 121 additions and 74 deletions

View File

@@ -9,7 +9,9 @@ type DropdownItemProps = {
const DropdownItem = ({ item, onClick, className }: DropdownItemProps) => {
return (
<li className={clsx(className, "cursor-pointer hover:bg-gray-100 px-4 py-2 align-middle")} onClick={() => onClick(item)}>
<li className={clsx(className, "cursor-pointer hover:bg-gray-100 px-4 py-2 align-middle")}
onClick={() => onClick(item)}
>
{item}
</li>
);
@@ -30,7 +32,7 @@ const Dropdown = ({ label, children, className }: DropdownProps) => {
};
useEffect(() => {
function handleClickOutside(event: { target: any; }) {
function handleClickOutside(event: { target: any }) {
if (ref.current && !ref.current.contains(event.target)) {
setIsOpen(false);
}