mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
[chore] fix some sonarcloud code smells
This commit is contained in:
@@ -15,7 +15,7 @@ export function BsmCheckbox({className, checked, onChange, disabled} : Props) {
|
||||
|
||||
const handleClick = () => {
|
||||
if(disabled){ return; }
|
||||
onChange && onChange(!checked);
|
||||
onChange?.(!checked);
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -56,7 +56,7 @@ export function BsmRange({colorType = "first-color", values, onChange, onFinalCh
|
||||
color: labelTextColor,
|
||||
}}
|
||||
>
|
||||
{renderLabel && renderLabel(values[index])}
|
||||
{renderLabel?.(values[index])}
|
||||
</div>
|
||||
)}
|
||||
/>
|
||||
|
||||
@@ -19,7 +19,7 @@ export function BsmSelect<T = unknown>(props: Props<T>) {
|
||||
|
||||
return (
|
||||
<select {...props} onChange={handleChange} defaultValue={props.options?.findIndex(opt => equal(opt.value, props.selected))}>
|
||||
{props.options && props.options.map((option, index) => (
|
||||
{props.options?.map((option, index) => (
|
||||
<option key={JSON.stringify(option)} value={index}>{t(option.text)}</option>
|
||||
))}
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user