import Link from 'next/link'; import { DidYouKnow } from 'src/interfaces/shared/title'; import styles from 'src/styles/modules/components/title/did-you-know.module.scss'; type Props = { data: DidYouKnow; }; const DidYouKnow = ({ data }: Props) => { if (!Object.keys(data).length) return <>; return (

Did you know

{data.trivia && (

Trivia

)} {data.goofs && (

Goofs

)} {data.quotes?.lines.length && ( // html spec says not to use blockquote & cite for conversations, even though it seems a perfect choice here. // see 'note' part https://html.spec.whatwg.org/multipage/grouping-content.html#the-blockquote-element

Quotes

{data.quotes.lines.map((line, i) => (

{line.name && ( {line.name} )} {line.stageDirection && [{line.stageDirection}] } {line.text && : {line.text}}

))}
)} {data.crazyCredits && (

Crazy credits

)} {data.alternativeVersions && (

Alternate versions

)} {data.connections && (

Connections

{data.connections.startText} {data.connections.title.text} ({data.connections.title.year})

)} {data.soundTrack && (

Soundtracks

{data.soundTrack.title}

{data.soundTrack.htmls && data.soundTrack.htmls.map(html => (
))}
)}
); }; export default DidYouKnow;