From 3c377d06a52d1c0dabf8a1f439e03b7831cb3e3f Mon Sep 17 00:00:00 2001 From: Shunya Hayashi Date: Tue, 22 Oct 2024 14:38:48 +0900 Subject: [PATCH 1/5] display plugin list --- .../PluginPlayground/Plugins/index.tsx | 150 +++++++++++++++++- 1 file changed, 148 insertions(+), 2 deletions(-) diff --git a/web/src/beta/features/PluginPlayground/Plugins/index.tsx b/web/src/beta/features/PluginPlayground/Plugins/index.tsx index 28d1faee47..ee76606de3 100644 --- a/web/src/beta/features/PluginPlayground/Plugins/index.tsx +++ b/web/src/beta/features/PluginPlayground/Plugins/index.tsx @@ -1,7 +1,153 @@ -import { FC } from "react"; +import { Button, Icon } from "@reearth/beta/lib/reearth-ui"; +import { styled } from "@reearth/services/styled"; +import { FC, useState } from "react"; + +// TODO Implement: display uploaded files +const mockPlugins = [ + { + id: "1", + name: "My Plugin" + }, + { + id: "2", + name: "My Plugin" + } +]; + +const mockFiles = [ + { + id: "1", + name: "widget.js" + }, + { + id: "2", + name: "table.js" + }, + { + id: "3", + name: "reearth.yml" + } +]; const Plugins: FC = () => { - return
Plugins content
; + const [selectedPlugin, setSelectedPlugin] = useState(0); + const [selectedFile, setSelectedFile] = useState(0); + + const onClickPluginItem = (i: number) => { + setSelectedPlugin(i); + }; + + const onClickFileItem = (i: number) => { + setSelectedFile(i); + }; + + return ( + + + + {mockPlugins.map((plugin, i) => ( + onClickPluginItem(i)} + > + {plugin.name} + + ))} + + + + +