k
This commit is contained in:
@@ -2,23 +2,22 @@ import {UseFormReturnType} from "@mantine/form";
|
||||
import {Button, Flex, rem} from "@mantine/core";
|
||||
import {FC} from "react";
|
||||
|
||||
type CreateProps<T> = {
|
||||
export type CreateProps<T> = {
|
||||
onCreate(values: T): void;
|
||||
}
|
||||
type EditProps<T> = {
|
||||
export type EditProps<T> = {
|
||||
onChange(values: T): void;
|
||||
element: T;
|
||||
}
|
||||
|
||||
export type CreateEditFormProps<T> = CreateProps<T> | EditProps<T>;
|
||||
|
||||
type BaseProps<T> = {
|
||||
export type BaseFormProps<T> = {
|
||||
form: UseFormReturnType<T>
|
||||
onClose: () => void;
|
||||
closeOnSubmit?: boolean;
|
||||
children: React.JSX.Element;
|
||||
}
|
||||
type Props<T> = BaseProps<T> & (CreateProps<T> | EditProps<T>);
|
||||
type Props<T> = BaseFormProps<T> & (CreateProps<T> | EditProps<T>);
|
||||
|
||||
const BaseFormModal = <T, >(props: Props<T>) => {
|
||||
const {closeOnSubmit = false} = props;
|
||||
|
||||
Reference in New Issue
Block a user