instance management and deactivation

This commit is contained in:
MapleLeaf
2021-12-25 12:30:49 -06:00
parent 433e445c1d
commit 5ee55ef3c0
4 changed files with 97 additions and 21 deletions

View File

@@ -4,7 +4,7 @@ import { EmbedField } from "../src.new/embed/embed-field.js"
import { EmbedTitle } from "../src.new/embed/embed-title.js"
import { Embed } from "../src.new/embed/embed.js"
export function Counter() {
export function Counter(props: { onDeactivate: () => void }) {
const [count, setCount] = React.useState(0)
const [embedVisible, setEmbedVisible] = React.useState(false)
@@ -32,6 +32,7 @@ export function Counter() {
{!embedVisible && (
<Button label="show embed" onClick={() => setEmbedVisible(true)} />
)}
<Button style="danger" label="deactivate" onClick={props.onDeactivate} />
</>
)
}