The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:
TypeScript analyticsbibusiness-intelligencebusinessintelligenceclojuredashboarddatadata-analysisdata-visualizationdatabasemetabasemysqlpostgrespostgresqlreportingslacksql-editorvisualization
import { useDisclosure } from "@mantine/hooks";
import { TableActionId, type TableEditingActionScope } from "../api/types";
import { useActionFormDescription } from "./use-table-action-form-description";
type UseTableCreateRowProps = {
scope: TableEditingActionScope;
};
export function useTableCreateRow({ scope }: UseTableCreateRowProps) {
const [
isCreateRowModalOpen,
{ open: openCreateRowModal, close: closeCreateRowModal },
] = useDisclosure(false);
const { data: formDescription } = useActionFormDescription({
actionId: TableActionId.CreateRow,
scope,
});
return {
isCreateRowModalOpen,
openCreateRowModal,
closeCreateRowModal,
formDescription,
};
}