import style from '../styles/title.module.css'; import Link from 'next/link'; type propsObj = { name: string, title?: string, ancestors?: Array<{ name: string, path: string }> }; function Title(props: propsObj) { const path = () => { if (!props.ancestors) return (<>); let currentPath = ''; return (<> { props.ancestors.map(ancestor => { currentPath += `/${ancestor.path}` return ( <> {ancestor.name} <> / ); }) } ); }; return ( <>

{props.title || props.name}

{ props.name === '' ? <>PaulW.XYZ / {props.name} : <>PaulW.XYZ / {path()}{props.name} }
); } export default Title;