forked from codesandbox/codesandbox-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.tsx
More file actions
28 lines (24 loc) · 806 Bytes
/
index.tsx
File metadata and controls
28 lines (24 loc) · 806 Bytes
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
import { Sandbox } from '@codesandbox/common/lib/types';
import { getSandboxName } from '@codesandbox/common/lib/utils/get-sandbox-name';
import React, { FunctionComponent } from 'react';
import AvatarBlock from '../AvatarBlock';
import { Container, Description, Stats, Title } from './elements';
type Props = {
sandbox: Sandbox;
};
export const SandboxInfo: FunctionComponent<Props> = ({ sandbox }) => {
const title = getSandboxName(sandbox);
return (
<Container>
<Title title={title}>{title}</Title>
{sandbox.description && <Description>{sandbox.description}</Description>}
{sandbox.author && (
<AvatarBlock
url={sandbox.author.avatarUrl}
name={sandbox.author.username}
/>
)}
<Stats {...sandbox} />
</Container>
);
};