import React, { FC } from 'react'; import styled from '@emotion/styled'; import { Button, IButtonProps } from '@yandex-lego/components/Button/desktop/bundle'; import { ArcIcon, FigmaIcon, StorybookIcon } from '../icons'; import { H1, Subheader } from './Typography'; import { Flex } from './Flex'; type PageHeaderProps = { title: string; description: string; links: { label: string; url: string }[]; }; export const PageHeader: FC = (props) => { const { title, description, links } = props; return (

{title}

{description && {description}}
{links && }
); }; // FIXME: Вынести отсюда и сделать добавление иконки и текста декларативно const LINKS_MAP: Record = { source: { label: 'Code', iconProvider: (className: string) => , }, storybook: { label: 'Playground', iconProvider: (className: string) => , }, figma: { label: 'Design', iconProvider: (className: string) => , }, }; const PageLinks = (props) => { const { links } = props; return ( {links.map(({ label: id, url }) => { const { label = id, iconProvider } = LINKS_MAP[id] || {}; return ( ); })} ); }; const Container = styled.div` display: flex; justify-content: space-between; box-sizing: border-box; grid-area: hero; min-height: 190px; padding: 42px 56px; background-color: #f7f8fa; `; const Inner = styled.div` max-width: 640px; `;