1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-22 06:49:40 +02:00

refactor(containers): migrate volumes tab to react [EE-5209] (#10284)

This commit is contained in:
Chaim Lev-Ari 2023-09-21 05:31:00 +03:00 committed by GitHub
parent 16ccf5871e
commit e92f067e42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 398 additions and 143 deletions

View file

@ -19,9 +19,10 @@ interface Props<T> {
disabled?: boolean;
readOnly?: boolean;
className?: string;
'aria-label'?: string;
}
export function ButtonSelector<T extends string | number>({
export function ButtonSelector<T extends string | number | boolean>({
value,
onChange,
size,
@ -29,12 +30,17 @@ export function ButtonSelector<T extends string | number>({
disabled,
readOnly,
className,
'aria-label': ariaLabel,
}: Props<T>) {
return (
<ButtonGroup size={size} className={clsx(styles.group, className)}>
<ButtonGroup
size={size}
className={clsx(styles.group, className)}
aria-label={ariaLabel}
>
{options.map((option) => (
<OptionItem
key={option.value}
key={option.value.toString()}
selected={value === option.value}
onChange={() => onChange(option.value)}
disabled={disabled}