fix(dashboard): some more rending fixes due to some strange behaivers

This commit is contained in:
2025-06-23 16:46:46 -05:00
parent 3b56a5e3e2
commit f4dd572a8f
6 changed files with 58 additions and 96 deletions

View 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>
);
};

View File

@@ -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: "",