import { GenesysDevIcon, GenesysDevIcons } from 'genesys-dev-icons'; import React from 'react'; import { BaseComponentProps } from '..'; import './DxLabel.scss'; interface IProps extends BaseComponentProps { label?: string; description?: string; useFieldset?: boolean; className?: string; children: React.ReactNode; } export default function DxLabel(props: IProps) { const hasLabel = props.label && props.label !== ''; const description = props.description ? (
{props.description}
) : undefined; const contents = ( {' '} {hasLabel ? {props.label} : undefined} {props.children} {description} ); const className = `dx-label${props.className ? ' ' + props.className : ''}`; if (props.useFieldset) { return
{contents}
; } return ( ); }