mirror of
https://github.com/grafana/grafana.git
synced 2025-02-13 00:55:47 -06:00
* 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
21 lines
515 B
TypeScript
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}
|
|
/>
|
|
);
|