mirror of
https://github.com/pterodactyl/panel.git
synced 2026-11-30 11:25:52 -05:00
Co-authored-by: Anthony <anthony@infraly.co> Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
25 lines
675 B
TypeScript
25 lines
675 B
TypeScript
import React from 'react';
|
|
import { cn } from '@/lib/cn';
|
|
|
|
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}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default Label;
|