mirror of
https://github.com/johndoe6345789/low-code-react-app-b.git
synced 2026-04-24 13:44:54 +00:00
23 lines
518 B
TypeScript
23 lines
518 B
TypeScript
import { ReactNode } from 'react'
|
|
import { cn } from '@/lib/utils'
|
|
|
|
interface HelperTextProps {
|
|
children: ReactNode
|
|
variant?: 'default' | 'error' | 'success'
|
|
className?: string
|
|
}
|
|
|
|
const variantClasses = {
|
|
default: 'text-muted-foreground',
|
|
error: 'text-destructive',
|
|
success: 'text-green-600',
|
|
}
|
|
|
|
export function HelperText({ children, variant = 'default', className }: HelperTextProps) {
|
|
return (
|
|
<p className={cn('text-xs mt-1', variantClasses[variant], className)}>
|
|
{children}
|
|
</p>
|
|
)
|
|
}
|