import { createAsync, useParams } from "@solidjs/router" import { client, getAnalysisList, paths } from "./api.ts"; import { createSignal, For, onMount, Show, Suspense } from "solid-js"; import { SolidApexCharts } from "solid-apexcharts"; type AnalysisResult = { status: 'not requested' } | { status: 'loading' } | { status: 'loaded', result: paths['/analysis/execute']['get']['responses'][200]['content']['application/json'] } export default function Analysis() { const pathParams = useParams(); const analysisId = pathParams.id!; let analysis = createAsync(() => getAnalysisList()); const analysisName = () => analysis()?.data?.find(it => it.id == analysisId)?.name const [startTimestamp, setStartTimestamp] = createSignal(new Date().getTime() - 1000 * 60 * 60 * 24 * 30); const [endTimestamp, setEndTimestamp] = createSignal(new Date().getTime()); const [analysisResult, setAnalysisResult] = createSignal({ status: 'not requested' }); return <>

{analysisName()}

it.status == 'loaded')}> {element => {item =>

([it.time, it.value])) } ]} >
} }

} function takeIf( obj: P, condition: (arg: P) => arg is T, ): T | false { return condition(obj) ? obj : false; }