import { useInvalidateAuthStore } from "@refinedev/core";
import { CrudForm } from "../../lib/crud/components/crud-form";
import {empty_user} from "../../providers/auth-provider";

export const CreateFirm = () => {
  const invalidateAuthStore = useInvalidateAuthStore()
  const refreshUser = () => {
    empty_user();
    invalidateAuthStore().then();
  }

  return (
    <CrudForm
      schemaName={"FirmCreate"}
      resource={"hub/users/firms/"}
      onSuccess={() => { refreshUser() }}
    />
  )
}
