import clsx from "clsx"; import React from "react"; import { gettextFirst } from "../../lib"; import "./logo.scss"; import { TRANSLATIONS } from "./translations"; export type LogoProps = { /** Whether to show the logo with a single letter ("M") instead of the full brand name ("MAYKIN"). */ abbreviated?: boolean; /** If set, provide a link. */ href?: string; /** The aria-label to set on the SVG element. */ label?: string; /** An aria-label describing the link action. */ hrefLabel?: string; /** Logo variant. */ variant?: "normal" | "contrast"; /** Gets passed as props. */ [index: string]: unknown; }; /** * The Maykin logo. * @param children * @param props * @constructor */ export const Logo: React.FC = ({ abbreviated = false, label, href, hrefLabel, variant = "normal", ...props }) => { const Tag = href ? "a" : "span"; const viewBoxWidth = abbreviated ? 47 : 122; const context = { href: href || "", }; const _label = gettextFirst(label, TRANSLATIONS.LABEL, context); const _hrefLabel = gettextFirst(hrefLabel, TRANSLATIONS.LABEL_HREF, context); return ( ); };