import React from "react"; import * as PageEditor from "../../types/PageEditor"; import * as Pages from "../../types/Pages"; import LocaleLinks from "./LocaleLinks"; interface PageDescriptionProps { state: PageEditor.State; dispatch: (action: PageEditor.Action) => void; children: React.ReactNode; } function editLink(locale: string, page: Pages.Ancestor | Pages.Resource) { return ( {pageName(locale, page)} ); } function pageName(locale: string, page: Pages.Ancestor | Pages.Resource) { if ("name" in page) { return page.name[locale]; } return page.blocks.name[locale] || Untitled; } export default function PageDescription(props: PageDescriptionProps) { const { state, dispatch, children } = props; const { locale, page } = state; return (