import styled, { useTheme } from 'styled-components';
import { getThemePropSelector } from '../../utils';
import { Icon } from '../icon/Icon.component';
import {
OptionProps,
Select,
SelectProps,
} from '../selectv2/Selectv2.component';
type OptionValue = {
label?: string;
} & OptionProps;
type Props = {
options?: OptionValue[];
} & SelectProps;
const SelectStyle = styled(Select)`
.sc-select__control {
background-color: ${getThemePropSelector('buttonSecondary')};
&.sc-select__control--is-focused {
background-color: ${getThemePropSelector('buttonSecondary')};
}
.sc-select__value-container {
overflow: visible;
}
&.sc-select__control--menu-is-open {
.sc-select__indicator {
transform: rotate(180deg);
}
}
}
`;
export const AllStatusIcon = () => {
const theme = useTheme();
return (
);
};
export const defaultOptions = [
{
icon: ,
label: 'All Status',
value: 'all',
},
{
icon: ,
label: 'Healthy',
value: 'healthy',
},
{
icon: ,
label: 'Warning',
value: 'warning',
},
{
icon: ,
label: 'Critical',
value: 'critical',
},
{
icon: ,
label: 'Unknown',
value: 'unknown',
},
] as const;
export const optionsDefaultConfiguration = {
all: defaultOptions[0],
healthy: defaultOptions[1],
warning: defaultOptions[2],
critical: defaultOptions[3],
unknown: defaultOptions[4],
};
function HealthSelectorv2(props: Props) {
const { options = defaultOptions, value, ...selectRest } = props;
let selectValue = value ?? options[0].value;
return (
{options.map((option, index) => {
const { ...optionRest } = option;
return (
{option.label}
);
})}
);
}
export const HealthSelector = HealthSelectorv2;