Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 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 React from "react";
import "./TitleDescription.css";
export interface TitleDescription {
title: React.ReactNode;
description: React.ReactNode;
size?: "h1" | "h2" | "h3";
}
const TitleDescription: React.FC<TitleDescription> = ({
title,
description,
size,
}) => {
size = size ?? "h1";
return (
<div className="flex flex-col gap-4">
{size === "h1" ? (
<h1>{title}</h1>
) : size === "h2" ? (
<h2>{title}</h2>
) : (
<h3 className="font-bold">{title}</h3>
)}
<p>{description}</p>
</div>
);
};
export default TitleDescription;
|