Add shadcn, tailwind and react detection & templates to bun create. Also: bun install --analyze <files...> (#17035)

This commit is contained in:
Jarred Sumner
2025-02-09 09:36:57 -08:00
committed by GitHub
parent 14164920b5
commit ba8573494a
62 changed files with 4437 additions and 282 deletions

View File

@@ -0,0 +1,41 @@
// This code isn't actually used by the client
// It exists so we can visually see the syntax highlighter in action
import { DraculaSyntaxHighlighter } from "./JavaScriptSyntaxHighlighter";
import "./JavaScriptSyntaxHighlighter.css";
interface SyntaxHighlighterProps {
code: string;
language?: string;
showLineNumbers?: boolean;
redactSensitiveInformation?: boolean;
className?: string;
style?: React.CSSProperties;
}
export const SyntaxHighlighter: React.FC<SyntaxHighlighterProps> = ({
code,
language = "javascript",
showLineNumbers = true,
redactSensitiveInformation = false,
className = "",
style = {},
}) => {
// Create a new instance of the highlighter
const highlighter = new DraculaSyntaxHighlighter(code, {
enableColors: true,
redactSensitiveInformation,
languageName: language,
showLineNumbers,
});
// Get the highlighted HTML
const highlightedCode = highlighter.highlight();
return (
<div
className={`dracula-syntax-highlighter ${className}`}
style={style}
dangerouslySetInnerHTML={{ __html: highlightedCode }}
/>
);
};