import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
import Title from "@/components/TempDesignSystem/Text/Title"

import SectionLink from "../Link"

import styles from "./header.module.css"

import type { HeaderProps } from "@/types/components/myPages/header"

export default function SectionHeader({
  link,
  subtitle,
  title,
  topTitle = false,
  textTransform,
}: HeaderProps) {
  return (
    <header className={styles.header}>
      <Title
        as={topTitle ? "h3" : "h4"}
        className={styles.title}
        level={topTitle ? "h1" : "h2"}
        textTransform={textTransform}
      >
        {title}
      </Title>
      {subtitle && <Subtitle className={styles.subtitle}>{subtitle}</Subtitle>}
      <SectionLink link={link} variant="desktop" />
    </header>
  )
}
