import HeaderStyle from "@/styles/Header.module.sass"
import NextLink from "next/link"


const Header = ({ href, kind, title, asList = false, withArrow = true }: { href: string, kind: "h1" | "h2" | "h3" | "h4" | "h5" | "h6", title: string, asList?: boolean, withArrow?: boolean }) => {
    let head;
    switch (kind) {
        case "h1":
            head = <h1 className={HeaderStyle.link}>{title}{withArrow ? " ↗" : ""}</h1 >
            break;
        case "h2":
            head = <h2 className={HeaderStyle.link}>{title}{withArrow ? " ↗" : ""}</h2 >
            break;
        case "h3":
            head = <h3 className={HeaderStyle.link}>{title}{withArrow ? " ↗" : ""}</h3 >
            break;
        case "h4":
            head = <h4 className={HeaderStyle.link}>{title}{withArrow ? " ↗" : ""}</h4 >
            break;
        case "h5":
            head = <h5 className={HeaderStyle.link}>{title}{withArrow ? " ↗" : ""}</h5 >
            break;
        case "h6":
            head = <h6 className={HeaderStyle.link}>{title}{withArrow ? " ↗" : ""}</h6 >
            break;

        default:
            break;
    }

    return (
        <NextLink href={href}>
            {head}
        </NextLink>
    )
};

export default Header; 