import {
Drawer,
type DrawerProps,
Modal,
type ModalProps,
Popover,
type PopoverProps,
} from '@mantine/core';
import type { FormerProps } from './Former.types';
import { Former } from './Former';
export const FormerDialog = (props: { former: FormerProps } & DrawerProps) => {
const { children, former, onClose, opened, ...rest } = props;
return (
{
const values = getState('values');
const request = getState('request');
const uniqueKeyField = getState('uniqueKeyField') ?? 'id';
return (
onClose?.()}
opened={opened ?? false}
>
{children}
);
}}
>
{children}
);
};
export const FormerModel = (props: { former: FormerProps } & ModalProps) => {
const { children, former, onClose, opened, ...rest } = props;
return (
{
const values = getState('values');
const request = getState('request');
const uniqueKeyField = getState('uniqueKeyField') ?? 'id';
return (
onClose?.()}
opened={opened ?? false}
>
{children}
);
}}
>
{children}
);
};
export const FormerPopover = (
props: { former: FormerProps; target: React.ReactNode } & PopoverProps
) => {
const { children, former, onClose, opened, target, ...rest } = props;
return (
{
return (
onClose?.()}
opened={opened ?? false}
>
{target}
{children}
);
}}
>
{children}
);
};