-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPageHeader.tsx
More file actions
45 lines (43 loc) · 1.24 KB
/
PageHeader.tsx
File metadata and controls
45 lines (43 loc) · 1.24 KB
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
41
42
43
44
45
import { Stack, Text } from '@react-universal/components';
import { A, H1, Span } from '@react-universal/elements';
import { LuArrowUpRight } from 'react-icons/lu';
import { titleCase } from 'scule';
interface PageHeaderProps {
title: string;
description: string;
links?: {
source?: string;
storybook?: string;
recipe?: string;
ark?: string;
};
}
export const PageHeader: React.FC<PageHeaderProps> = ({ title, description, links }) => (
<Stack sx={{ gap: '4', pb: '4' }}>
<H1 sx={{ fontSize: '1.875rem' }}>{title}</H1>
<Text sx={{ color: 'text.muted' }}>{description}</Text>
{links && (
<Stack direction="row" sx={{ gap: '6', mb: '4', flexWrap: 'wrap' }}>
{Object.entries(links).map(([title, url]) => (
<A
key={url}
href={url}
target="_blank"
rel="noopener noreferrer"
sx={{
color: 'text.muted',
fontSize: '0.875rem',
fontWeight: 400,
}}
>
{/* <ResourceIcon type={title} /> */}
{titleCase(title)}
<Span sx={{ color: 'text.muted' }}>
<LuArrowUpRight />
</Span>
</A>
))}
</Stack>
)}
</Stack>
);