blob: 8af58ece80b25046c2c7328340fcec572eeeac32 (
plain)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
|
import NextImage, { type ImageProps as NextImageProps } from 'next/image';
import type { FC } from 'react';
import { Figure } from '../../atoms';
import { Meta, type MetaData } from '../../molecules';
import styles from './overview.module.scss';
export type OverviewMeta = Pick<
MetaData,
| 'creation'
| 'license'
| 'popularity'
| 'repositories'
| 'technologies'
| 'update'
>;
export type OverviewProps = {
/**
* Set additional classnames to the overview wrapper.
*/
className?: string;
/**
* The overview cover.
*/
cover?: Pick<NextImageProps, 'alt' | 'src' | 'width' | 'height'>;
/**
* The overview meta.
*/
meta: OverviewMeta;
};
/**
* Overview component
*
* Render an overview.
*/
export const Overview: FC<OverviewProps> = ({
className = '',
cover,
meta,
}) => {
const { technologies, ...remainingMeta } = meta;
const metaModifier = technologies ? styles['meta--has-techno'] : '';
return (
<div className={`${styles.wrapper} ${className}`}>
{cover ? (
<Figure>
<NextImage {...cover} className={styles.cover} />
</Figure>
) : null}
<Meta
className={`${styles.meta} ${metaModifier}`}
data={{ ...remainingMeta, technologies }}
/>
</div>
);
};
|