1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2026-06-19 11:55:30 -04:00

chore: update shadcn primitives

This commit is contained in:
2026-01-28 13:56:39 -05:00
parent 5fc9efb181
commit 9d8e775fcd
51 changed files with 2206 additions and 301 deletions
+15 -1
View File
@@ -1,7 +1,21 @@
import { codeToHtml } from "shiki";
import { cacheLife } from "next/cache";
import CopyButton from "@/components/copy-button";
import { cn, getTextContent } from "@/lib/utils";
import { cn } from "@/lib/utils";
/**
* Recursively extracts plain text content from React nodes.
* Replacement for the `react-to-text` package.
*/
const getTextContent = (node: React.ReactNode): string => {
if (node == null || typeof node === "boolean") return "";
if (typeof node === "string" || typeof node === "number") return String(node);
if (Array.isArray(node)) return node.map(getTextContent).join("");
if (typeof node === "object" && "props" in node) {
return getTextContent((node as React.ReactElement<{ children?: React.ReactNode }>).props.children);
}
return "";
};
interface CodeBlockProps extends React.ComponentProps<"pre"> {
showLineNumbers?: boolean;