mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 15:29:42 +02:00
refactor(ui/box-selector): replace all selectors [EE-3856] (#7902)
This commit is contained in:
parent
c9253319d9
commit
2dddc1c6b9
80 changed files with 1267 additions and 1011 deletions
|
@ -2,21 +2,26 @@ import { Rocket } from 'lucide-react';
|
|||
|
||||
import { render, fireEvent } from '@/react-tools/test-utils';
|
||||
|
||||
import { BoxSelector, Props } from './BoxSelector';
|
||||
import { BoxSelectorOption } from './types';
|
||||
import { BoxSelector } from './BoxSelector';
|
||||
import { BoxSelectorOption, Value } from './types';
|
||||
|
||||
function renderDefault<T extends string | number>({
|
||||
function renderDefault<T extends Value>({
|
||||
options = [],
|
||||
onChange = () => {},
|
||||
radioName = 'radio',
|
||||
value,
|
||||
}: Partial<Props<T>> = {}) {
|
||||
}: {
|
||||
options?: BoxSelectorOption<T>[];
|
||||
onChange?: (value: T) => void;
|
||||
radioName?: string;
|
||||
value: T;
|
||||
}) {
|
||||
return render(
|
||||
<BoxSelector
|
||||
options={options}
|
||||
onChange={onChange}
|
||||
radioName={radioName}
|
||||
value={value || 0}
|
||||
value={value}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue