import { RichText } from "@/components/general/RichText";
import styles from "./pageHeader.module.scss";

export const PageHeader = ({
  heading,
  lead,
  align
}: {
  heading: string;
  lead?: string | null;
  align?: "center" | "left"
}) => {
  return (
    <div className={`${styles.pageHeader} ${align && styles[align]}`}>
      <h1 className={styles.title}>{heading}</h1>
      {lead && (
        <div className="lead">
          <RichText content={lead} />
        </div>
      )}
    </div>
  );
};
