merge fix
This commit is contained in:
@@ -13,6 +13,7 @@ interface DropDownListProps {
|
||||
kebabMenuItems?: { id: string; name: string }[]; // Items for the KebabMenuList
|
||||
defaultOpen?: boolean; // Determines if the dropdown list should be open by default
|
||||
listType?: string; // Type of list to display
|
||||
remove?: boolean;
|
||||
}
|
||||
|
||||
const DropDownList: React.FC<DropDownListProps> = ({
|
||||
@@ -28,25 +29,29 @@ const DropDownList: React.FC<DropDownListProps> = ({
|
||||
],
|
||||
defaultOpen = false,
|
||||
listType = "default",
|
||||
remove,
|
||||
}) => {
|
||||
const [isOpen, setIsOpen] = useState<boolean>(defaultOpen);
|
||||
|
||||
const handleToggle = () => {
|
||||
setIsOpen((prev) => !prev); // Toggle the state
|
||||
};
|
||||
const [zoneDataList, setZoneDataList] = useState<{ id: string; name: string }[]>([]);
|
||||
const [zoneDataList, setZoneDataList] = useState<
|
||||
{ id: string; name: string }[]
|
||||
>([]);
|
||||
|
||||
useEffect(() => {
|
||||
async function GetZoneData() {
|
||||
const response = await getZonesApi("hexrfactory")
|
||||
console.log('response: ', response.data);
|
||||
setZoneDataList([{ id: "1", name: "zone1" },
|
||||
{ id: "2", name: "Zone 2" },])
|
||||
const response = await getZonesApi("hexrfactory");
|
||||
console.log("response: ", response.data);
|
||||
setZoneDataList([
|
||||
{ id: "1", name: "zone1" },
|
||||
{ id: "2", name: "Zone 2" },
|
||||
]);
|
||||
}
|
||||
|
||||
GetZoneData()
|
||||
|
||||
}, [])
|
||||
GetZoneData();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="dropdown-list-container">
|
||||
@@ -81,7 +86,7 @@ const DropDownList: React.FC<DropDownListProps> = ({
|
||||
</div>
|
||||
{isOpen && (
|
||||
<div className="lists-container">
|
||||
{listType === "default" && <List items={items} />}
|
||||
{listType === "default" && <List items={items} remove={remove} />}
|
||||
{listType === "outline" && (
|
||||
<>
|
||||
<DropDownList
|
||||
|
||||
Reference in New Issue
Block a user