MCPcopy Create free account
hub / github.com/CommandCodeAI/BaseAI / Code

Function Code

apps/baseai.dev/src/components/Code.tsx:376–394  ·  view source on GitHub ↗
({
	children,
	...props
}: React.ComponentPropsWithoutRef<'code'>)

Source from the content-addressed store, hash-verified

374}
375
376export function Code({
377 children,
378 ...props
379}: React.ComponentPropsWithoutRef<'code'>) {
380 let isGrouped = useContext(CodeGroupContext);
381
382 if (isGrouped) {
383 if (typeof children !== 'string') {
384 throw new Error(
385 '`Code` children must be a string when nested inside a `CodeGroup`.'
386 );
387 }
388 return (
389 <code {...props} dangerouslySetInnerHTML={{ __html: children }} />
390 );
391 }
392
393 return <code {...props}>{children}</code>;
394}
395
396export function Pre({
397 children,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected