@@ -2,31 +2,53 @@ import Head from "next/head";
22import React from "react" ;
33import { Client } from "@codetest/editor-client" ;
44import Link from "next/link" ;
5+ import styled from "@emotion/styled" ;
6+ import { ArchiveIcon } from "@radix-ui/react-icons" ;
57
68export default function QAFilesPage ( { files } ) {
79 return (
810 < >
911 < Head >
10- < title > QA - Files </ title >
12+ < title > @codetest/reports </ title >
1113 </ Head >
12- < main >
13- < h1 > QA - Files</ h1 >
14+ < main
15+ style = { {
16+ fontFamily : "monospace" ,
17+ margin : "auto" ,
18+ marginTop : 120 ,
19+ width : 400 ,
20+ } }
21+ >
22+ < h1 >
23+ < code > @codetest/reports</ code >
24+ </ h1 >
25+ < p >
26+ reports coverage generated by < code > @codetest/reports</ code > (locally)
27+ will be listed here
28+ </ p >
1429 < div
1530 style = { {
1631 display : "flex" ,
1732 flexDirection : "column" ,
33+ gap : 8 ,
1834 } }
1935 >
2036 { files . map ( ( file ) => (
2137 < Link
2238 href = { {
23- pathname : `/test /reports/[key]` ,
39+ pathname : `/tests /reports/[key]` ,
2440 query : {
2541 key : file ,
2642 } ,
2743 } }
2844 >
29- < a > { file } </ a >
45+ < Row >
46+ < a href = { file } >
47+ < ArchiveIcon />
48+ < div style = { { width : 8 } } />
49+ reports/{ file }
50+ </ a >
51+ </ Row >
3052 </ Link >
3153 ) ) }
3254 </ div >
@@ -35,6 +57,23 @@ export default function QAFilesPage({ files }) {
3557 ) ;
3658}
3759
60+ const Row = styled . div `
61+ cursor: pointer;
62+ padding: 16px;
63+ background: rgba(0, 0, 0, 0.1);
64+ border-radius: 4;
65+ border: 1px solid rgba(255, 255, 255, 0.1);
66+
67+ a {
68+ display: flex;
69+ align-items: center;
70+ }
71+
72+ &:hover {
73+ background: rgba(0, 0, 0, 0.2);
74+ }
75+ ` ;
76+
3877export async function getServerSideProps ( context : any ) {
3978 const client = Client ( {
4079 baseURL : "http://localhost:6627" ,
@@ -50,7 +89,10 @@ export async function getServerSideProps(context: any) {
5089 } ;
5190 } catch ( e ) {
5291 return {
53- notFound : true ,
92+ redirect : {
93+ destination : "/tests/reports/how-to-setup" ,
94+ permanent : false ,
95+ } ,
5496 } ;
5597 }
5698}
0 commit comments