mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-24 01:48:18 +03:00
15 lines
385 B
TypeScript
15 lines
385 B
TypeScript
|
import { FC, ReactElement } from 'react';
|
||
|
import { useToggle } from '../../src/utils/helpers/hooks';
|
||
|
|
||
|
interface RenderModalArgs {
|
||
|
isOpen: boolean;
|
||
|
toggle: () => void;
|
||
|
}
|
||
|
|
||
|
export const TestModalWrapper: FC<{ renderModal: (args: RenderModalArgs) => ReactElement }> = (
|
||
|
{ renderModal },
|
||
|
) => {
|
||
|
const [isOpen, toggle] = useToggle(true);
|
||
|
return renderModal({ isOpen, toggle });
|
||
|
};
|