diff options
author | Jasper Ras <jras@hostnet.nl> | 2024-11-28 15:55:03 +0100 |
---|---|---|
committer | Jasper Ras <jras@hostnet.nl> | 2024-11-28 15:55:03 +0100 |
commit | b44f4a11380516dbb1a8fcfc6627d669a87d2473 (patch) | |
tree | 97b45c1ecb2398a7a6185569ba8fcb77a3ad1b77 /widget/Button.tsx | |
parent | 7f729d18d9d85f914b6cb1f4df81207caeee4b61 (diff) |
barzz
Diffstat (limited to 'widget/Button.tsx')
-rw-r--r-- | widget/Button.tsx | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/widget/Button.tsx b/widget/Button.tsx deleted file mode 100644 index abc24ca..0000000 --- a/widget/Button.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { Variable, bind } from "astal" - -type Props = { - p: string - child?: JSX.Element - children?: Array<JSX.Element> -} - -export default function MyButton({p, child, children}: Props) { - const count = Variable(0) - const labels = [p +"1", p +"2"] - - if (child) { - console.log(child.label) - } - - function increment() { - count.set(count.get() + 1) - } - - function handleClick(self, ...args) { - console.log(self, "was clicked") - } - return <box> - {labels.map(label => ( - <button onClick={handleClick}> - <label label={label}></label> - </button> - ))} - <button onClick={increment}> - <label label={bind(count).as(num => num.toString())}></label> - </button> - </box> -} |