mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-08-28 05:25:33 +00:00
24 lines
546 B
TypeScript
24 lines
546 B
TypeScript
'use client';
|
|
|
|
import React from 'react';
|
|
|
|
import { cn, withRef } from '@udecode/cn';
|
|
import { PlateLeaf } from '@udecode/plate-common/react';
|
|
|
|
export const CodeLeaf = withRef<typeof PlateLeaf>(
|
|
({ children, className, ...props }, ref) => {
|
|
return (
|
|
<PlateLeaf
|
|
ref={ref}
|
|
asChild
|
|
className={cn(
|
|
'whitespace-pre-wrap rounded-md bg-muted px-[0.3em] py-[0.2em] font-mono text-sm',
|
|
className
|
|
)}
|
|
{...props}
|
|
>
|
|
<code>{children}</code>
|
|
</PlateLeaf>
|
|
);
|
|
}
|
|
);
|