mirror of
https://github.com/johndoe6345789/low-code-react-app-b.git
synced 2026-04-26 06:34:54 +00:00
35 lines
756 B
TypeScript
35 lines
756 B
TypeScript
import { cn } from '@/lib/utils'
|
|
|
|
interface KeyValueProps {
|
|
label: string
|
|
value: React.ReactNode
|
|
orientation?: 'horizontal' | 'vertical'
|
|
className?: string
|
|
labelClassName?: string
|
|
valueClassName?: string
|
|
}
|
|
|
|
export function KeyValue({
|
|
label,
|
|
value,
|
|
orientation = 'horizontal',
|
|
className,
|
|
labelClassName,
|
|
valueClassName
|
|
}: KeyValueProps) {
|
|
return (
|
|
<div className={cn(
|
|
'flex gap-2',
|
|
orientation === 'vertical' ? 'flex-col' : 'flex-row items-center justify-between',
|
|
className
|
|
)}>
|
|
<span className={cn('text-sm text-muted-foreground', labelClassName)}>
|
|
{label}
|
|
</span>
|
|
<span className={cn('text-sm font-medium', valueClassName)}>
|
|
{value}
|
|
</span>
|
|
</div>
|
|
)
|
|
}
|