1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-26 15:37:41 +01:00
smov/src3/components/layout/SectionHeading.tsx

38 lines
971 B
TypeScript
Raw Normal View History

2022-02-10 23:45:17 +01:00
import { Icon, Icons } from "components/Icon";
2022-02-25 21:23:16 +01:00
import { ArrowLink } from "components/text/ArrowLink";
2022-02-10 23:45:17 +01:00
import { ReactNode } from "react";
interface SectionHeadingProps {
icon?: Icons;
title: string;
children?: ReactNode;
2022-02-18 20:22:56 +01:00
linkText?: string;
onClick?: () => void;
className?: string;
2022-02-10 23:45:17 +01:00
}
export function SectionHeading(props: SectionHeadingProps) {
return (
<div className={`mt-12 ${props.className}`}>
2022-02-18 20:22:56 +01:00
<div className="mb-4 flex items-end">
<p className="text-denim-700 flex flex-1 items-center font-bold uppercase">
{props.icon ? (
<span className="mr-2 text-xl">
<Icon icon={props.icon} />
</span>
) : null}
{props.title}
</p>
{props.linkText ? (
<ArrowLink
2022-02-18 20:22:56 +01:00
linkText={props.linkText}
direction="left"
onClick={props.onClick}
/>
2022-02-10 23:45:17 +01:00
) : null}
2022-02-18 20:22:56 +01:00
</div>
2022-02-10 23:45:17 +01:00
{props.children}
</div>
);
}