-
Notifications
You must be signed in to change notification settings - Fork 390
Expand file tree
/
Copy pathindex.tsx
More file actions
31 lines (29 loc) · 771 Bytes
/
index.tsx
File metadata and controls
31 lines (29 loc) · 771 Bytes
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
import { SpacingProp } from "@/types/style";
import { H2, P } from "../text";
import s from "./GenericCard.module.css";
import Image, { ImageProps } from "next/image";
interface GenericCardProps {
title: string;
image?: ImageProps;
description: string;
padding?: SpacingProp;
children?: React.ReactNode;
}
export default function GenericCard({
title,
image,
padding = "56px",
description,
children,
}: GenericCardProps) {
return (
<div className={s.genericCard}>
{image ? <Image {...image} /> : null}
<div style={{ padding }}>
<H2 className={s.title}>{title}</H2>
<P className={s.description}>{description}</P>
{children ? <div className={s.children}>{children}</div> : null}
</div>
</div>
);
}