blob: 87e9a2c114a8299c41c7cde44e5a5c9d02c3da6a [file] [log] [blame]
pineafanf5dd1872023-02-28 17:33:16 +00001import React from 'react';
2
3function Testing(props) {
4 return <>
5 <div style={{
6 width: "100vw",
7 height: "40px",
8 backgroundColor: "#F27878",
9 display: "flex",
10 justifyContent: "left",
11 alignItems: "center",
12 paddingLeft: "25px",
13 color: "white",
14 fontSize: "1.5em",
15 }}>Nucleus Transcripts</div>
16 <div style={{
17 height: "100vw",
18 width: "100vw",
19 backgroundColor: "var(--theme-ui-colors-background)",
20 margintop: "-50px",
21 padding: "25px",
22 paddingTop: "10px",
23 transition: "all 0.3s ease-in-out"
24 }}>
TheCodedProfc86e44b2023-02-28 17:30:57 -050025 {
26 props.humanReadable.split("\n").map((s, i) => {
27 return <p key={i}>{s}</p>
28 })
29 }
pineafanf5dd1872023-02-28 17:33:16 +000030 </div>
31 </>
32}
33
34export default Testing;
35export async function getServerSideProps(ctx) {
36 if(!ctx.query.code) {
37 return {
38 redirect: {
39 destination: '/nucleus/transcript/about',
40 permanent: true
41 }
42 }
43 }
44 if (ctx.query.code === "test") {
45 return {
46 props: {
TheCodedProfc86e44b2023-02-28 17:30:57 -050047 humanReadable: "This is a test string! It should render correctly on the page\nAnd a newline!"
pineafanf5dd1872023-02-28 17:33:16 +000048 }
49 }
50 } else {
51 return {
52 redirect: {
53 destination: '/nucleus/transcript/invalid',
54 permanent: true
55 }
56 }
57 }
58}