2026-10-05 18:10:18 -04:00
|
|
|
import React from 'react';
|
|
|
|
|
import { cn } from '@/lib/cn';
|
2020-07-04 12:39:55 -07:00
|
|
|
|
2026-10-05 18:10:18 -04:00
|
|
|
type Props<E extends React.ElementType = 'label'> = {
|
|
|
|
|
as?: E;
|
|
|
|
|
isLight?: boolean;
|
|
|
|
|
} & Omit<React.ComponentPropsWithoutRef<E>, 'as' | 'isLight'>;
|
|
|
|
|
|
|
|
|
|
const Label = <E extends React.ElementType = 'label'>({ as, isLight, className, ...props }: Props<E>) => {
|
|
|
|
|
const Component = (as || 'label') as React.ElementType;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Component
|
|
|
|
|
className={cn(
|
|
|
|
|
'block text-sm font-medium uppercase text-foreground mb-1',
|
|
|
|
|
isLight && 'text-muted-foreground',
|
|
|
|
|
className
|
|
|
|
|
)}
|
|
|
|
|
{...props}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
};
|
2020-07-04 12:39:55 -07:00
|
|
|
|
|
|
|
|
export default Label;
|