blob: 20866870ba994a92f00b60b2fbf08f06f74808a4 [file] [log] [blame]
// Copyright 2022 The Pigweed Authors
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy of
// the License at
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.
import type {NextPage} from 'next'
import Head from 'next/head'
import styles from '../styles/Home.module.scss';
import Log from "../components/log";
import Repl from "../components/repl";
import Connect from "../components/connect";
import BtnUploadDB from '../components/uploadDb';
import {WebSerial, Device} from "pigweedjs";
import {useState} from 'react';
type WebSerialTransport = WebSerial.WebSerialTransport
const Home: NextPage = () => {
const [device, setDevice] = useState<Device | undefined>(undefined);
const [tokenDB, setTokenDB] = useState("");
return (
<div className={styles.container}>
<title>Pigweed Console</title>
<meta name="description" content="Generated by create next app" />
<link rel="icon" href="/favicon.png" />
<main className={styles.main}>
<div className={styles.toolbar}>
<span className={styles.logo}><span>Pigweed</span> Web Console</span>
<Connect onConnection={(device) => {
}} />
<BtnUploadDB onUpload={(db) => {
}} />
<div className={styles.grid}>
<Log device={device} tokenDB={tokenDB}></Log>
<Repl device={device}></Repl>
export default Home