2022-08-17 03:49:21 +03:00
|
|
|
import cn from 'classnames';
|
2022-09-07 10:00:28 +03:00
|
|
|
import { FC } from 'react';
|
2022-09-10 09:03:49 +03:00
|
|
|
import Linkify from 'react-linkify';
|
2022-09-07 10:00:28 +03:00
|
|
|
import { Logo } from '../../ui/Logo/Logo';
|
|
|
|
import { SocialLinks } from '../../ui/SocialLinks/SocialLinks';
|
2022-08-17 03:49:21 +03:00
|
|
|
import { SocialLink } from '../../../interfaces/social-link.model';
|
2022-09-07 10:00:28 +03:00
|
|
|
import styles from './ContentHeader.module.scss';
|
2022-08-17 03:49:21 +03:00
|
|
|
|
2022-09-07 10:00:28 +03:00
|
|
|
export type ContentHeaderProps = {
|
2022-08-17 03:49:21 +03:00
|
|
|
name: string;
|
|
|
|
title: string;
|
|
|
|
summary: string;
|
|
|
|
tags: string[];
|
|
|
|
links: SocialLink[];
|
|
|
|
logo: string;
|
2022-09-07 10:00:28 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
export const ContentHeader: FC<ContentHeaderProps> = ({
|
|
|
|
name,
|
|
|
|
title,
|
|
|
|
summary,
|
|
|
|
logo,
|
|
|
|
tags,
|
|
|
|
links,
|
|
|
|
}) => (
|
|
|
|
<div className={styles.root}>
|
|
|
|
<div className={styles.logoTitleSection}>
|
|
|
|
<div className={styles.logo}>
|
|
|
|
<Logo src={logo} />
|
|
|
|
</div>
|
|
|
|
<div className={styles.titleSection}>
|
|
|
|
<div className={cn(styles.title, styles.row)}>{name}</div>
|
2022-09-10 09:03:49 +03:00
|
|
|
<div className={cn(styles.subtitle, styles.row)}>
|
|
|
|
<Linkify>{title || summary}</Linkify>
|
|
|
|
</div>
|
2022-09-07 10:00:28 +03:00
|
|
|
<div className={cn(styles.tagList, styles.row)}>
|
|
|
|
{tags.length > 0 && tags.map(tag => <span key={tag}>#{tag} </span>)}
|
2022-08-17 03:49:21 +03:00
|
|
|
</div>
|
2022-09-07 10:00:28 +03:00
|
|
|
<div className={cn(styles.socialLinks, styles.row)}>
|
|
|
|
<SocialLinks links={links} />
|
2022-08-17 03:49:21 +03:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-09-07 10:00:28 +03:00
|
|
|
</div>
|
|
|
|
);
|