import type { Component } from 'solid-js' import type { RunPhase, TestSummary } from '~/components/types' import { createMemo, Show } from 'solid-js' import { SummaryCard } from '~/components' import { formatDuration } from '~/components/utils' export interface DashboardProps { summary: TestSummary phase: RunPhase } const Dashboard: Component = (props) => { const hasTests = createMemo(() => props.summary.total > 0 || props.phase === 'running') const passRate = createMemo(() => { const total = props.summary.passed + props.summary.failed if (total === 0) return 0 return Math.round((props.summary.passed / total) * 100) }) return (

No test results yet

Press Run Tests to start

)} >

{passRate()} %

Pass Rate

{formatDuration(props.summary.duration)}

Duration

Running {' '} {props.summary.running} {' '} test {props.summary.running !== 1 ? 's' : ''} ...
) } export default Dashboard