import React, { ReactNode } from "react"; import classNames from "classnames"; import { filterAttrs } from "@arc-ui/community-utils/filter-attrs"; import { Text } from "@arc-ui/components/Text"; import { VerticalSpace } from "@arc-ui/components/VerticalSpace"; import { Image, type ImageProps } from "@arc-ui/components/Image"; import { Heading, type HeadingLevel } from "@arc-ui/components/Heading"; import { Columns, ColumnsCol } from "@arc-ui/components/Columns"; import styles from "./SectionHeading.module.css"; export const SectionHeading: React.FC = ({ heading, content, id, image, isHeadingWordWrap, isPadded = false, headingLevel = "2", isCentered = false, ...props }) => (
{image && } {heading}
{content && (
{content}
)}
); export interface SectionHeadingProps { /** * heading for `SectionHeading`. */ heading: string; /** * Adds padding to `SectionHeading`. */ isPadded?: boolean; /** * Determine a heading level for `SectionHeading`. */ headingLevel?: HeadingLevel; /** * Word wrap behavior for the heading */ isHeadingWordWrap?: boolean; /** * Text content for `SectionHeading`. */ content?: string | ReactNode; /** * Id content for `SectionHeading`. */ id?: string; /** * Header image for the `SectionHeading`. */ image?: ImageProps; /** * Is Heading centered. Only intended to be used when no content is provided and the heading is alone. */ isCentered?: boolean; }