MCPcopy Create free account
hub / github.com/sqlchat/sqlchat / pre

Function pre

src/components/ConversationView/MessageView.tsx:120–135  ·  view source on GitHub ↗
({ node, className, children, ...props })

Source from the content-addressed store, hash-verified

118 remarkPlugins={[remarkGfm]}
119 components={{
120 pre({ node, className, children, ...props }) {
121 const child = children[0] as ReactElement;
122 const match = /language-(\w+)/.exec(child.props.className || "");
123 const language = match ? match[1] : "SQL";
124 return (
125 <pre className={`${className || ""} w-full p-0 my-1`} {...props}>
126 <CodeBlock
127 key={Math.random()}
128 messageId={message.id}
129 language={language || "SQL"}
130 value={String(child.props.children).replace(/\n$/, "")}
131 {...props}
132 />
133 </pre>
134 );
135 },
136 code({ children }) {
137 return <code className="px-0">{children}</code>;
138 },

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected