From 52f6ca1c587df2cc74b986bc82419c867c404f47 Mon Sep 17 00:00:00 2001 From: Jonas Dellinger Date: Sat, 23 Apr 2022 00:42:11 +0200 Subject: Initial commit --- src/index.tsx | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/index.tsx (limited to 'src') diff --git a/src/index.tsx b/src/index.tsx new file mode 100644 index 0000000..56301a7 --- /dev/null +++ b/src/index.tsx @@ -0,0 +1,51 @@ +import { + Button, + definePlugin, + PanelSection, + PanelSectionRow, + ServerAPI, + TabTitle, +} from "decky-frontend-lib"; +import { useState, VFC } from "react"; +import { FaShip } from "react-icons/fa"; + +interface AddMethodArgs { + left: number; + right: number; +} + +const Content: VFC<{ serverAPI: ServerAPI }> = ({ serverAPI }) => { + const [result, setResult] = useState(); + + const onClick = async () => { + const result = await serverAPI.callPluginMethod( + "add", + { + left: 2, + right: 2, + } + ); + if (result.success) { + setResult(result.result); + } + }; + + return ( + + + +
Server says: {result}
+
+
+ ); +}; + +export default definePlugin((serverApi) => { + return { + title: Example Plugin, + content: , + icon: , + }; +}); -- cgit v1.2.3