shlink-web-client/shlink-web-component/test/__helpers__/TestModalWrapper.tsx
2023-08-04 11:16:01 +02:00

14 lines
393 B
TypeScript

import type { FC, ReactElement } from 'react';
import { useToggle } from '../../../shlink-frontend-kit/src';
interface RenderModalArgs {
isOpen: boolean;
toggle: () => void;
}
export const TestModalWrapper: FC<{ renderModal: (args: RenderModalArgs) => ReactElement }> = (
{ renderModal },
) => {
const [isOpen, toggle] = useToggle(true);
return renderModal({ isOpen, toggle });
};