mirror of
https://github.com/pterodactyl/panel.git
synced 2026-12-01 03:45:53 -05:00
17 lines
553 B
TypeScript
17 lines
553 B
TypeScript
import React from 'react';
|
|
import { useSkin } from '@/themes/skins';
|
|
|
|
export type LabelProps<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 }: LabelProps<E>) => {
|
|
const Component = (as || 'label') as React.ElementType;
|
|
const ui = useSkin('Label', { light: !!isLight });
|
|
|
|
return <Component {...ui('root', className)} {...props} />;
|
|
};
|
|
|
|
export default Label;
|