week-5-module-2 / src /components /ContentPage.tsx
iurbinah's picture
Upload 6 files
9be548f verified
raw
history blame contribute delete
586 Bytes
import React from 'react';
import { SlideData } from '../data/slides';
import { styles } from '../styles/appStyles';
import ContentRenderer from './ContentRenderer';
const ContentPage = ({ data }: { data: SlideData; }) => (
<>
{data.title && <h1 style={styles.title}>{data.title}</h1>}
{data.subtitle && <h2 style={styles.subtitle} dangerouslySetInnerHTML={{ __html: data.subtitle }} />}
{data.author && <p style={styles.author}>{data.author}</p>}
{data.content && <ContentRenderer content={data.content} />}
</>
);
export default ContentPage;