diff --git a/web/ui/mantine-ui/src/pages/AlertStateMultiSelect.tsx b/web/ui/mantine-ui/src/pages/AlertStateMultiSelect.tsx deleted file mode 100644 index 5d237ec1e..000000000 --- a/web/ui/mantine-ui/src/pages/AlertStateMultiSelect.tsx +++ /dev/null @@ -1,135 +0,0 @@ -import { useState } from "react"; -import { - Badge, - CheckIcon, - CloseButton, - Combobox, - ComboboxChevron, - ComboboxClearButton, - Group, - Input, - Pill, - PillGroup, - PillsInput, - useCombobox, -} from "@mantine/core"; -import badgeClasses from "../Badge.module.css"; -import { IconFilter } from "@tabler/icons-react"; -import { IconFilterSearch } from "@tabler/icons-react"; - -interface StatePillProps extends React.ComponentPropsWithoutRef<"div"> { - value: string; - onRemove?: () => void; -} - -export function StatePill({ value, onRemove, ...others }: StatePillProps) { - return ( - - {value} - - ); -} - -export function AlertStateMultiSelect() { - const combobox = useCombobox({ - onDropdownClose: () => combobox.resetSelectedOption(), - onDropdownOpen: () => combobox.updateSelectedOptionIndex("active"), - }); - - const [values, setValues] = useState([]); - - const handleValueSelect = (val: string) => - setValues((current) => - current.includes(val) - ? current.filter((v) => v !== val) - : [...current, val] - ); - - const handleValueRemove = (val: string) => - setValues((current) => current.filter((v) => v !== val)); - - const renderedValues = values.map((item) => ( - handleValueRemove(item)} - key={item} - /> - )); - - const options = ["inactive", "pending", "firing"].map((value) => { - return ( - - - {values.includes(value) ? : null} - - - - ); - }); - - return ( - - - combobox.toggleDropdown()} - miw={200} - leftSection={} - rightSection={ - values.length > 0 ? ( - setValues([])} /> - ) : ( - - ) - } - > - - {renderedValues.length > 0 ? ( - renderedValues - ) : ( - Filter by alert state - )} - - - combobox.closeDropdown()} - onKeyDown={(event) => { - if (event.key === "Backspace") { - event.preventDefault(); - handleValueRemove(values[values.length - 1]); - } - }} - /> - - - - - - - {options} - - - ); -}