-
Notifications
You must be signed in to change notification settings - Fork 827
Expand file tree
/
Copy pathLibraryDescription.tsx
More file actions
28 lines (25 loc) · 907 Bytes
/
LibraryDescription.tsx
File metadata and controls
28 lines (25 loc) · 907 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 * as emoji from 'node-emoji';
import { Linkify } from 'react-easy-linkify';
import { A, Caption, Headline } from '~/common/styleguide';
import { type LibraryType } from '~/types';
import tw from '~/util/tailwind';
type Props = {
github: LibraryType['github'];
maxLines?: number;
};
export default function LibraryDescription({ github, maxLines }: Props) {
return github.description && github.description.length > 0 ? (
<Headline numberOfLines={maxLines} style={tw`text-base font-light leading-snug`}>
<Linkify
options={{
linkWrapper: ({ children, ...rest }) => <A {...rest}>{children}</A>,
}}>
{emoji.emojify(github.description)}
</Linkify>
</Headline>
) : (
<Caption style={tw`text-base font-light leading-snug text-palette-gray4 dark:text-secondary`}>
The package does not have a description defined.
</Caption>
);
}