mirror of
https://github.com/johndoe6345789/low-code-react-app-b.git
synced 2026-04-24 13:44:54 +00:00
- Introduced Timestamp component for displaying formatted dates and relative time. - Added Toggle component for switch-like functionality with customizable sizes. - Implemented TreeIcon component for rendering tree icons using Phosphor icons. - Created EditorActions component for explain and improve actions with icons. - Developed FileTabs component for managing open files with close functionality. - Added LazyInlineMonacoEditor and LazyMonacoEditor for lazy loading Monaco editor. - Implemented NavigationItem for navigation with badges and icons. - Created PageHeaderContent for displaying page headers with icons and descriptions. - Added JSON configuration files for various UI components and layouts. - Enhanced data binding with new computed data source hook. - Updated component registry and types for new components. - Configured Vite for improved hot module replacement experience.
35 lines
660 B
TypeScript
35 lines
660 B
TypeScript
import { ReactNode } from 'react'
|
|
import { cn } from '@/lib/utils'
|
|
|
|
interface CodeProps {
|
|
children: ReactNode
|
|
inline?: boolean
|
|
className?: string
|
|
}
|
|
|
|
export function Code({ children, inline = true, className }: CodeProps) {
|
|
if (inline) {
|
|
return (
|
|
<code
|
|
className={cn(
|
|
'px-1.5 py-0.5 rounded bg-muted text-foreground font-mono text-sm',
|
|
className
|
|
)}
|
|
>
|
|
{children}
|
|
</code>
|
|
)
|
|
}
|
|
|
|
return (
|
|
<pre
|
|
className={cn(
|
|
'p-4 rounded-lg bg-muted text-foreground font-mono text-sm overflow-x-auto',
|
|
className
|
|
)}
|
|
>
|
|
<code>{children}</code>
|
|
</pre>
|
|
)
|
|
}
|