-
Notifications
You must be signed in to change notification settings - Fork 396
/
Copy pathwelcome.tsx
39 lines (36 loc) · 936 Bytes
/
welcome.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import React from "react"
import { Card, CardGrid, CardItem } from "../WelcomeCard/welcome-card"
import styles from "./welcome.module.css"
// Interface for the section props
export interface WelcomePageSectionProps {
id: string
title?: string
description?: string
cards: Array<CardItem>
}
// Section Component
const WelcomePageSection: React.FC<WelcomePageSectionProps> = ({
id,
title,
description,
cards,
}) => {
return (
<section id={id}>
{(title || description) && (
<div className={styles.sectionHeading}>
{title && <h2 className={styles.sectionTitle}>{title}</h2>}
{description && (
<p className={styles.sectionDescription}>{description}</p>
)}
</div>
)}
<CardGrid>
{cards.map((card, index) => (
<Card key={index} {...card} />
))}
</CardGrid>
</section>
)
}
export default WelcomePageSection