import { ErrorBoundary } from "react-error-boundary"; import NextLink from "next/link"; import Time from "../Time"; import HitCounter from "../HitCounter"; import NoteTitle from "../NoteTitle"; import { DateIcon, TagIcon, EditIcon, ViewsIcon } from "../Icons"; import { styled } from "../../lib/styles/stitches.config"; import * as config from "../../lib/config"; import type { NoteFrontMatter } from "../../types"; const Wrapper = styled("div", { display: "inline-flex", flexWrap: "wrap", fontSize: "0.825em", lineHeight: 2.3, letterSpacing: "0.04em", color: "$medium", }); const MetaItem = styled("div", { marginRight: "1.6em", whiteSpace: "nowrap", }); const MetaLink = styled(NextLink, { color: "inherit", textDecoration: "none", }); const Icon = styled("svg", { width: "1.2em", height: "1.2em", verticalAlign: "-0.2em", marginRight: "0.6em", }); const TagsList = styled("span", { whiteSpace: "normal", display: "inline-flex", flexWrap: "wrap", }); const Tag = styled("span", { textTransform: "lowercase", whiteSpace: "nowrap", marginRight: "0.75em", "&::before": { content: "\\0023", // cosmetically hashtagify tags paddingRight: "0.125em", color: "$light", }, "&:last-of-type": { marginRight: 0, }, }); export type NoteMetaProps = Pick; const NoteMeta = ({ slug, date, title, htmlTitle, tags = [] }: NoteMetaProps) => ( <> {tags.length > 0 && ( {tags.map((tag) => ( {tag} ))} )} Improve This Post {/* only count hits on production site */} {process.env.NEXT_PUBLIC_VERCEL_ENV === "production" && ( )} ); export default NoteMeta;