Files
pterodactyl-panel/resources/scripts/components/elements/Label.tsx
T
6c0413e39b Start 2.0 development
Co-authored-by: Anthony <anthony@infraly.co>
Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
2026-10-05 18:10:18 -04:00

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;