2020-05-14 15:30:24 +03:00
|
|
|
import React from 'react';
|
|
|
|
|
|
2023-03-30 15:30:15 +03:00
|
|
|
interface IProps {
|
2020-05-14 15:30:24 +03:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The text for the Label.
|
|
|
|
|
*/
|
2023-03-30 15:30:15 +03:00
|
|
|
children: React.ReactElement;
|
2020-05-14 15:30:24 +03:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The CSS class of the label.
|
|
|
|
|
*/
|
2023-03-30 15:30:15 +03:00
|
|
|
className?: string;
|
2020-05-14 15:30:24 +03:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The (round) number prefix for the Label.
|
|
|
|
|
*/
|
2023-03-30 15:30:15 +03:00
|
|
|
number?: string | number;
|
2020-05-14 15:30:24 +03:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The click handler.
|
|
|
|
|
*/
|
2023-03-30 15:30:15 +03:00
|
|
|
onClick?: (e?: React.MouseEvent) => void;
|
|
|
|
|
}
|
2020-05-14 15:30:24 +03:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Label for the dialogs.
|
|
|
|
|
*
|
|
|
|
|
* @returns {ReactElement}
|
|
|
|
|
*/
|
2023-03-30 15:30:15 +03:00
|
|
|
function Label({ children, className, number, onClick }: IProps) {
|
2020-05-14 15:30:24 +03:00
|
|
|
const containerClass = className
|
|
|
|
|
? `prejoin-dialog-label ${className}`
|
|
|
|
|
: 'prejoin-dialog-label';
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
className = { containerClass }
|
|
|
|
|
onClick = { onClick }>
|
|
|
|
|
{number && <div className = 'prejoin-dialog-label-num'>{number}</div>}
|
|
|
|
|
<span>{children}</span>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default Label;
|