fix(dashboard): some more rending fixes due to some strange behaivers
This commit is contained in:
34
frontend/src/utils/formStuff/options/checkbox.tsx
Normal file
34
frontend/src/utils/formStuff/options/checkbox.tsx
Normal file
@@ -0,0 +1,34 @@
|
||||
import { Checkbox } from "@radix-ui/react-checkbox";
|
||||
import { useFieldContext } from "..";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { FieldErrors } from "./FieldErrors";
|
||||
|
||||
type CheckboxFieldProps = {
|
||||
label: string;
|
||||
description?: string;
|
||||
};
|
||||
|
||||
export const CheckboxField = ({ label }: CheckboxFieldProps) => {
|
||||
const field = useFieldContext<boolean>();
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="m-2 p-2 flex flex-row">
|
||||
<div>
|
||||
<Label htmlFor="active">
|
||||
<span>{label}</span>
|
||||
</Label>
|
||||
</div>
|
||||
<Checkbox
|
||||
id={field.name}
|
||||
checked={field.state.value}
|
||||
onCheckedChange={(checked) => {
|
||||
field.handleChange(checked === true);
|
||||
}}
|
||||
onBlur={field.handleBlur}
|
||||
/>
|
||||
</div>
|
||||
<FieldErrors meta={field.state.meta} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -13,7 +13,7 @@ export function getinventoryCheck(data: any) {
|
||||
}
|
||||
|
||||
const fetchStockSilo = async (info: any) => {
|
||||
console.log(info);
|
||||
//console.log("What tpye of info:", info);
|
||||
const { data } = await axios.post(`/api/logistics/cyclecountcheck`, {
|
||||
age: info.age ? parseInt(info.age) : null,
|
||||
type: "",
|
||||
|
||||
Reference in New Issue
Block a user