2025-08-04 12:04:33 -07:00
|
|
|
import Widget from "./Widget";
|
2025-08-05 17:12:59 -07:00
|
|
|
import { HStack, Box, Field, Input, Button } from "@chakra-ui/react";
|
|
|
|
|
import { useForm } from "react-hook-form";
|
2025-08-04 12:04:33 -07:00
|
|
|
|
|
|
|
|
export default function AlertLevel({id, isEditable, isDelete, DeleteWidget}) {
|
2025-08-05 17:12:59 -07:00
|
|
|
const { register, handleSubmit } = useForm();
|
|
|
|
|
const onSubmit = (data) => console.log(data);
|
|
|
|
|
|
2025-08-04 12:04:33 -07:00
|
|
|
return (
|
|
|
|
|
<Widget id={id} title="Alert Level" isEditable={isEditable} isDelete={isDelete} DeleteWidget={DeleteWidget}>
|
2025-08-05 17:12:59 -07:00
|
|
|
<Box
|
|
|
|
|
as="form"
|
|
|
|
|
onSubmit={handleSubmit(onSubmit)}
|
|
|
|
|
width="100%"
|
|
|
|
|
height="100%"
|
|
|
|
|
p={2}
|
|
|
|
|
>
|
2025-08-06 12:03:48 -07:00
|
|
|
<Field.Root orientation="horizontal" >
|
|
|
|
|
<HStack display="flex" spacing={4} align="center" width="100%">
|
|
|
|
|
<Field.Label display="flex" whiteSpace="nowrap">Country Name</Field.Label>
|
2025-08-05 17:12:59 -07:00
|
|
|
<Input {...register("countryname")} placeholder="Enter country name"/>
|
|
|
|
|
</HStack>
|
|
|
|
|
</Field.Root>
|
|
|
|
|
</Box>
|
2025-08-04 12:04:33 -07:00
|
|
|
</Widget>
|
|
|
|
|
);
|
|
|
|
|
}
|