-
Notifications
You must be signed in to change notification settings - Fork 128
/
Info.tsx
40 lines (36 loc) · 792 Bytes
/
Info.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import React from 'react'
import { LinkResource } from '../resources'
import { VerticalSpacer } from './Spacer'
interface LinkProps {
url: string
title: string
}
function Link({ url, title }: LinkProps) {
return (
<li>
<a href={url}>{title}</a>
</li>
)
}
interface Props {
title: string
content: string
links: LinkResource[]
}
export default function Info({ title, content, links }: Props) {
return (
<>
<h2>{title}</h2>
<VerticalSpacer size={20} />
<p>{content}</p>
<VerticalSpacer size={20} />
<span className="label">Resources</span>
<VerticalSpacer size={12} />
<ul>
{links.map((link, index) => (
<Link key={index} url={link.url} title={link.title} />
))}
</ul>
</>
)
}