You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/app/react/edge/components/EdgeScriptForm/OsSelector.tsx

48 lines
1.0 KiB

import { LayoutGrid } from 'lucide-react';
import Linux from '@/assets/ico/linux.svg?c';
import { ButtonSelector } from '@@/form-components/ButtonSelector/ButtonSelector';
import { Icon } from '@@/Icon';
import { OS } from './types';
interface Props {
value: OS;
onChange(value: OS): void;
}
export function OsSelector({ onChange, value }: Props) {
return (
<div className="form-group">
<div className="col-sm-12">
<ButtonSelector
size="small"
value={value}
onChange={(os: OS) => onChange(os)}
options={[
{
value: 'linux',
label: (
<>
<Icon icon={Linux} className="mr-1" />
Linux
</>
),
},
{
value: 'win',
label: (
<>
<Icon icon={LayoutGrid} className="mr-1" />
Windows
</>
),
},
]}
/>
</div>
</div>
);
}