church-website/src/components/EventExcerpt/EventExcerpt.tsx
2024-12-03 12:04:02 +01:00

44 lines
No EOL
830 B
TypeScript

import styles from "./styles.module.scss"
import { TextDiv } from '@/components/Text/TextDiv'
type EventExcerptProps = {
what?: string | null,
where?: string | null,
who?: string | null
}
type RowProps = {
label: string,
text: string
}
const Row = ({label, text}: RowProps) => {
return (
<div className={styles.row}>
<div className={styles.col1}>
{label}
</div>
<div>
<TextDiv text={text} />
</div>
</div>
)
}
export const EventExcerpt = ({ what, where, who }: EventExcerptProps) => {
return (
<div className={styles.container}>
{ what &&
<Row label={"Was:"} text={what} />
}
{ where &&
<Row label={"Wo:"} text={where} />
}
{ who &&
<Row label={"Ansprechperson:"} text={who} />
}
</div>
)
}