import React from 'react'; import styled from 'styled-components'; import type { JSX } from 'react'; import type { MarkdownConfig } from '@redocly/config'; import { EditPageButton } from '@redocly/theme/components/Buttons/EditPageButton'; import { LastUpdated } from '@redocly/theme/components/LastUpdated/LastUpdated'; import { Breadcrumbs as ThemeBreadcrumbs } from '@redocly/theme/components/Breadcrumbs/Breadcrumbs'; type DocumentationLayoutTopProps = { config?: MarkdownConfig; editPage?: { to: string; }; /** String in ISO format */ lastModified?: string | null; }; export function DocumentationLayoutTop({ config, editPage, lastModified, }: React.PropsWithChildren): JSX.Element { const { editPage: themeEditPage } = config || {}; const mergedConf = editPage ? { ...themeEditPage, ...editPage } : undefined; return ( {lastModified && } {mergedConf && } ); } const Wrapper = styled.div` display: flex; flex-direction: column; `; const LayoutTop = styled.div` display: flex; justify-content: space-between; flex-flow: row nowrap; `; const Breadcrumbs = styled(ThemeBreadcrumbs)` margin-bottom: var(--breadcrumbs-margin-bottom); `;