|
1
|
import clsx from "clsx" |
|
2
|
import React from "react" |
|
3
|
import { ShadedBlock } from "../../ShadedBlock" |
|
4
|
|
|
5
|
export type H1Props = React.HTMLAttributes<HTMLHeadingElement> & { |
|
6
|
id?: string |
|
7
|
variant?: "default" | "content" |
|
8
|
} |
|
9
|
|
|
10
|
export const H1 = ({ className, variant = "default", ...props }: H1Props) => { |
|
11
|
return ( |
|
12
|
<div className="flex flex-col items-start justify-between gap-docs_1 mb-docs_1 h1-wrapper"> |
|
13
|
<h1 |
|
14
|
className={clsx( |
|
15
|
"text-h1 [&>code]:!text-h1 [&>code]:!font-mono text-medusa-fg-base", |
|
16
|
props.id && "scroll-m-docs_7", |
|
17
|
className |
|
18
|
)} |
|
19
|
{...props} |
|
20
|
/> |
|
21
|
{variant === "content" && <ShadedBlock className="!w-full !h-docs_2" />} |
|
22
|
</div> |
|
23
|
) |
|
24
|
} |