import React, { useState } from "react"; import List from "./List"; import { AddIcon, ArrowIcon, FocusIcon } from "../../icons/ExportCommonIcons"; import KebabMenuListMultiSelect from "./KebebMenuListMultiSelect"; interface DropDownListProps { value?: string; // Value to display in the DropDownList items?: { id: string; name: string }[]; // Items to display in the dropdown list showFocusIcon?: boolean; // Determines if the FocusIcon should be displayed showAddIcon?: boolean; // Determines if the AddIcon should be displayed showKebabMenu?: boolean; // Determines if the KebabMenuList should be displayed 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 } const DropDownList: React.FC = ({ value = "Dropdown", items = [], showFocusIcon = false, showAddIcon = true, showKebabMenu = true, kebabMenuItems = [ { id: "Buildings", name: "Buildings" }, { id: "Paths", name: "Paths" }, { id: "Zones", name: "Zones" }, ], defaultOpen = false, listType = "default", }) => { const [isOpen, setIsOpen] = useState(defaultOpen); const handleToggle = () => { setIsOpen((prev) => !prev); // Toggle the state }; return (
{value}
{showFocusIcon && (
)} {showAddIcon && (
)} {showKebabMenu && (
)}
{isOpen && (
{listType === "default" && } {listType === "outline" && ( <> )}
)}
); }; export default DropDownList;