-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtitle-block.tsx
36 lines (34 loc) · 1000 Bytes
/
title-block.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
import { ArrowRight } from 'lucide-react';
import Link from 'next/link';
type TitleBlockProps = {
title: string;
subtitle: string;
icon?: React.ReactNode;
section?: string;
href?: string;
};
export default function TitleBlock({
title,
subtitle,
icon,
section,
href = '#',
}: TitleBlockProps) {
return (
<div className="space-y-4 flex flex-col md:items-center md:text-center flex-1">
{section && (
<Link href={href}>
<div className="flex items-center gap-2 py-1 px-3 w-fit rounded-full border border-border dark:border-none bg-secondary">
{icon}
<span className="text-md font-medium lg:text-base">{section}</span>
<ArrowRight size={16} />
</div>
</Link>
)}
<h2 className="font-semibold text-2xl lg:text-4xl ">{title}</h2>
<p className="text-slate-500 dark:text-slate-400 leading-loose lg:text-xl lg:leading-relaxed max-w-3xl">
{subtitle}
</p>
</div>
);
}