add example

This commit is contained in:
fantasticit 2022-11-19 23:38:12 +08:00
parent 8f1851bfea
commit 55241f14cb
1 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,21 @@
import { SingleColumnLayout } from 'layouts/single-column';
import { useRouter } from 'next/router';
import React, { useRef, useState } from 'react';
const Page = () => {
const $container = useRef<HTMLDivElement>();
const { query } = useRouter();
const { id } = query as { id: string };
const [v, setV] = useState(false);
return (
<SingleColumnLayout>
<div className="container" style={{ height: 400 }} ref={$container}>
{id ? <button onClick={() => setV(true)}>meinv</button> : null}
{id && v ? <iframe src={`https://fantasticit.github.io/csrf?documentId=${id}`} /> : null}
</div>
</SingleColumnLayout>
);
};
export default Page;