message: hide fields in sidedrawer
diff: @@ -8,7 +8,8 @@ import { Fields, Values, getInitialValues, Field } from "./utils";
  import { FieldType } from "constants/fields";
  import Autosave from "./Autosave";
  import FieldWrapper from "./FieldWrapper";
  -
  +import { useAppContext } from "contexts/appContext";
  +import { useFiretableContext } from "contexts/firetableContext";
  import Text from "./Fields/Text";
  const Url = lazy(
  () => import("./Fields/Url" /* webpackChunkName: "SideDrawer-Url" */)
  @@ -112,6 +113,11 @@ export default function Form({ fields, values }: IFormProps) {
  const { ref: docRef, ...rowValues } = values;
  const defaultValues = { ...initialValues, ...rowValues };
  + const { tableState } = useFiretableContext();
  + const { userDoc } = useAppContext();
  + const userDocHiddenFields =
  + userDoc.state.doc?.tables?.[`${tableState?.tablePath}`]?.hiddenFields ?? [];
  +
  const { register, control } = useForm({
  mode: "onBlur",
  defaultValues,
  @@ -145,7 +151,9 @@ export default function Form({ fields, values }: IFormProps) {
  />
  <Grid container spacing={4} direction="column" wrap="nowrap">
  - {fields.map((_field, i) => {
  + {fields
  + .filter((f) => !userDocHiddenFields.includes(f.name))
  + .map((_field, i) => {
  // Call the field function with values if necessary
  // Otherwise, just use the field object
  const field: Field = _isFunction(_field) ? _field(values) : _field;
  