import NextLink from "next/link"
import LinkStyle from "@/styles/Link.module.sass"
import { CSSProperties } from "react";

const Link = ({ href, title, asList = false, withArrow = false, style }: { href: string, title: string, asList?: boolean, withArrow?: boolean, style?: CSSProperties }) => {
    const relme = [
        'fediverse'
    ]

    return (
        <NextLink style={style} href={href} rel={relme.includes(title) ? "me" : undefined}>
            {asList ? (<span className={LinkStyle.listLink}>{title}{withArrow ? " ↗" : ""}</span>) : (<span className={LinkStyle.link}>{title}{withArrow ? " ↗" : ""}</span >)}
        </NextLink>
    );
};

export default Link; 