grafana/public/app/features/admin/OrgRolePicker.tsx
Tobias Skarhed 9bbc007cb9
Input: Width prop (#23615)
* Add width property

* Remove unused import

* Spelling mistake

* Add width to interface

* Make width optional

* Remove size

* Update snapshot

* Remove size from places

* Add size prop for button

* Update width

* Update snapshots
2020-04-21 10:42:57 +02:00

21 lines
515 B
TypeScript

import React, { FC } from 'react';
import { OrgRole } from '@grafana/data';
import { Select } from '@grafana/ui';
interface Props {
value: OrgRole;
onChange: (role: OrgRole) => void;
}
const options = Object.keys(OrgRole).map(key => ({ label: key, value: key }));
export const OrgRolePicker: FC<Props> = ({ value, onChange, ...restProps }) => (
<Select
value={value}
options={options}
onChange={val => onChange(val.value as OrgRole)}
placeholder="Choose role..."
{...restProps}
/>
);