import React, { useEffect, useState } from "react"; import Head from "next/head"; import { useTheme } from "@chakra-ui/core"; import useConfig from "~/components/HyperglassProvider"; import { googleFontUrl } from "~/util"; const Meta = () => { const config = useConfig(); const theme = useTheme(); const [location, setLocation] = useState({}); const title = config?.site_title || "hyperglass"; const description = config?.site_description || "The modern looking glass."; const siteName = `${title} - ${description}`; const keywords = config?.site_keywords || [ "hyperglass", "looking glass", "lg", "peer", "peering", "ipv4", "ipv6", "transit", "community", "communities", "bgp", "routing", "network", "isp" ]; const language = config?.language ?? "en"; const primaryFont = googleFontUrl(theme.fonts.body); const monoFont = googleFontUrl(theme.fonts.mono); useEffect(() => { if (typeof window !== "undefined" && location === {}) { setLocation(window.location); } }, [location]); return ( {title} ); }; export default Meta;