Support filtering to own/all servers if user is an admin
This commit is contained in:
parent
67c6be9f6f
commit
f45c03a449
4 changed files with 86 additions and 19 deletions
|
@ -36,7 +36,7 @@ const ToggleContainer = styled.div`
|
|||
|
||||
export interface SwitchProps {
|
||||
name: string;
|
||||
label: string;
|
||||
label?: string;
|
||||
description?: string;
|
||||
defaultChecked?: boolean;
|
||||
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
||||
|
@ -48,7 +48,7 @@ const Switch = ({ name, label, description, defaultChecked, onChange, children }
|
|||
|
||||
return (
|
||||
<div className={'flex items-center'}>
|
||||
<ToggleContainer className={'mr-4 flex-none'}>
|
||||
<ToggleContainer className={'flex-none'}>
|
||||
{children
|
||||
|| <input
|
||||
id={uuid}
|
||||
|
@ -60,17 +60,21 @@ const Switch = ({ name, label, description, defaultChecked, onChange, children }
|
|||
}
|
||||
<label htmlFor={uuid}/>
|
||||
</ToggleContainer>
|
||||
<div className={'w-full'}>
|
||||
{(label || description) &&
|
||||
<div className={'ml-4 w-full'}>
|
||||
{label &&
|
||||
<label
|
||||
className={classNames('input-dark-label cursor-pointer', { 'mb-0': !!description })}
|
||||
htmlFor={uuid}
|
||||
>{label}</label>
|
||||
}
|
||||
{description &&
|
||||
<p className={'input-help'}>
|
||||
{description}
|
||||
</p>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
Reference in a new issue