bbgo_origin/apps/bbgo-backtest-report/pages/index.tsx
2022-05-19 01:00:45 +08:00

49 lines
1.4 KiB
TypeScript

import type {NextPage} from 'next'
import Head from 'next/head'
import styles from '../styles/Home.module.css'
import {AppShell, Header, Navbar, Text} from '@mantine/core';
import ReportDetails from '../components/ReportDetails';
import ReportNavigator from '../components/ReportNavigator';
import {useState} from "react";
const Home: NextPage = () => {
const [currentReport, setCurrentReport] = useState<any>();
return (
<div>
<Head>
<title>BBGO Back-Test Report</title>
<meta name="description" content="Generated by create next app"/>
<link rel="icon" href="/favicon.ico"/>
</Head>
<main className={styles.main}>
<AppShell
padding="md"
navbar={<Navbar width={{base: 250}} height={500} p="xs">
<ReportNavigator onSelect={(reportEntry) => {
setCurrentReport(reportEntry)
}}/>
</Navbar>}
header={
<Header height={60} p="md">
<Text>BBGO Back-Test Report</Text>
</Header>
}
styles={(theme) => ({
main: {backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[8] : theme.colors.gray[0]},
})}
>
{
currentReport ? <ReportDetails basePath={'/output'} runID={currentReport.id}/> : null
}
</AppShell>
</main>
</div>
)
}
export default Home