Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. ๐ซ Status page with uptime monitoring & API monitoring as code ๐ซ openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor
Something went wrong. Try again.
748 B ยท 30 lines
TSX
12345678910111213141516171819202122232425262728293031import type React from "react";import { highlight } from "sugar-high";
export function Code({ children, className, ...props}: React.ComponentProps<"code">) { // Only apply syntax highlighting if a language is specified (className contains "language-") const hasLanguage = className?.includes("language-");
if (hasLanguage) { const codeHTML = highlight(children?.toString() ?? ""); return ( <code // oxlint-disable-next-line react/no-danger dangerouslySetInnerHTML={{ __html: codeHTML }} className={className} {...props} /> ); }
// Plain code block without language - render as-is return ( <code className={className} {...props}> {children} </code> );}