prometheus/web/ui/mantine-ui/src/pages/query/QueryPage.tsx
Julius Volz 2bb14c5787 Lots of more progress on the new Mantine UI
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2024-03-07 13:16:54 +01:00

30 lines
742 B
TypeScript

import { Button, Stack } from "@mantine/core";
import { IconPlus } from "@tabler/icons-react";
import { useAppDispatch, useAppSelector } from "../../state/hooks";
import { addPanel } from "../../state/queryPageSlice";
import Panel from "./QueryPanel";
export default function QueryPage() {
const panels = useAppSelector((state) => state.queryPage.panels);
const dispatch = useAppDispatch();
return (
<>
<Stack gap="xl">
{panels.map((p, idx) => (
<Panel key={p.id} idx={idx} />
))}
</Stack>
<Button
variant="light"
mt="xl"
leftSection={<IconPlus size={18} />}
onClick={() => dispatch(addPanel())}
>
Add query
</Button>
</>
);
}