import { Group, Select } from "@mantine/core";

export function AlertFilters({ filters, setFilters, nodeOptions }) {
  return (
    <Group spacing="md">
      <Select
        label="严重性"
        value={filters.severity}
        onChange={(value) => setFilters((f) => ({ ...f, severity: value }))}
        data={[
          { value: "all", label: "全部" },
          { value: "critical", label: "严重" },
          { value: "warning", label: "警告" },
          { value: "info", label: "信息" },
        ]}
        w={150}
      />
      <Select
        label="状态"
        value={filters.state}
        onChange={(value) => setFilters((f) => ({ ...f, state: value }))}
        data={[
          { value: "all", label: "全部" },
          { value: "active", label: "Active" },
          { value: "resolved", label: "Resolved" },
        ]}
        w={150}
      />
      <Select
        label="节点"
        value={filters.instance}
        onChange={(value) => setFilters((f) => ({ ...f, instance: value }))}
        data={nodeOptions}
        w={150}
      />
    </Group>
  );
}
