import { ReactNode } from 'react'; import { mixed } from 'yup'; import { ContainerConfig } from 'docker-types/generated/1.41'; import { AutomationTestingProps } from '@/types'; import { FormControl } from '@@/form-components/FormControl'; const consoleSettingTypes = ['tty', 'interactive', 'both', 'none'] as const; export type ConsoleSetting = (typeof consoleSettingTypes)[number]; export type ConsoleConfig = Pick; export function ConsoleSettings({ value, onChange, }: { value: ConsoleSetting; onChange(value: ConsoleSetting): void; }) { return ( Interactive & TTY (-i -t) } selected={value} data-cy="container-console-interactive-tty" /> Interactive (-i) } selected={value} data-cy="container-console-interactive" /> TTY (-t) } selected={value} data-cy="container-console-tty" /> None} selected={value} data-cy="container-console-none" /> ); function handleChange(value: ConsoleSetting) { onChange(value); } } function Item({ value, selected, onChange, label, 'data-cy': dataCy, }: { value: ConsoleSetting; selected: ConsoleSetting; onChange(value: ConsoleSetting): void; label: ReactNode; } & AutomationTestingProps) { return ( ); } export function validation() { return mixed() .oneOf([...consoleSettingTypes]) .default('none'); }