24 lines
496 B
TypeScript
24 lines
496 B
TypeScript
import React from "react";
|
|
import {Subapp, useSubapp} from "../src/Components/Subapps/Subapps";
|
|
import {Card} from "../src/Components/Card";
|
|
|
|
/**
|
|
* A demo Subapp component.
|
|
*/
|
|
export function DemoSubapp()
|
|
{
|
|
// Get subapp close function.
|
|
const {uuid, close} = useSubapp();
|
|
|
|
return (
|
|
<Subapp title={"My complex subapp"}>
|
|
<Card>
|
|
<p>This is a complex subapp.</p>
|
|
|
|
<p>UUID : <code>{uuid}</code></p>
|
|
|
|
<button onClick={close}>Close the subapp</button>
|
|
</Card>
|
|
</Subapp>
|
|
);
|
|
}
|