import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
// @ts-ignore
import { Helmet } from "react-helmet";
import { useGetLang } from "../../hooks";
const Head = (props) => {
    const { canonical, title, description, baseURL, previewPath } = props;
    const website = baseURL ?? "https://equilibrium.io";
    const lang = useGetLang();
    const canonicalLang = "en";
    const canonicalUrl = canonical
        ? `${website}/${canonicalLang}/${canonical}`
        : website;
    const previewImagePath = previewPath ?? "equilibrium.png";
    const shema = `
  {
    "@context": "http://schema.org",
  "@type": "WebSite",
  "url": "${canonicalUrl}",
  "name": "${title}",
  "description": "${description}",
  "image": "${website}/${previewImagePath}"
  }`;
    return (_jsx(_Fragment, { children: _jsxs(Helmet, { children: [_jsx("html", { lang: lang }), _jsx("title", { children: title }), _jsx("meta", { name: "description", content: description }), _jsx("link", { rel: "canonical", href: canonicalUrl }), _jsx("link", { rel: "alternate", hrefLang: "en", href: canonical ? `${website}/en/${canonical}` : `${website}/en` }), _jsx("link", { rel: "alternate", hrefLang: "zh", href: canonical ? `${website}/zh/${canonical}` : `${website}/zh` }), _jsx("meta", { property: "og:title", content: title }), _jsx("meta", { property: "og:type", content: "website" }), _jsx("meta", { property: "og:url", content: canonicalUrl }), _jsx("meta", { property: "og:image", content: `${website}/${previewImagePath}` }), _jsx("meta", { property: "og:description", content: description }), _jsx("meta", { property: "og:site_name", content: title }), _jsx("meta", { name: "twitter:card", content: "summary_large_image" }), _jsx("meta", { name: "twitter:site", content: canonicalUrl }), _jsx("meta", { name: "twitter:title", content: title }), _jsx("meta", { name: "twitter:description", content: description }), _jsx("meta", { name: "twitter:image:src", content: `${website}/${previewImagePath}` }), _jsx("meta", { name: "twitter:domain", content: website }), props.children, _jsx("script", { type: "application/ld+json", children: shema })] }) }));
};
export default Head;
//# sourceMappingURL=index.js.map