import type { ComponentProps, ComponentType, FunctionComponent } from 'react'; import { useState } from 'react'; import { Dialog, DialogProps, DialogWrapperContext, WrapperProps } from '@/components/elements/dialog'; function asDialog( initialProps?: WrapperProps, // eslint-disable-next-line @typescript-eslint/ban-types ):

(C: ComponentType

) => FunctionComponent

{ return function (Component) { return function ({ open, onClose, ...rest }) { const [props, setProps] = useState(initialProps || {}); return (

)} /> ); }; }; } export default asDialog;