import React from 'react'; import type { Option } from 'react-select'; import Select from 'react-select'; import { AuthenticationService } from '../../../authentication'; import { HelpField } from '../../../help'; const { useState, useEffect } = React; export interface IPipelineRolesConfigProps { roles: any[]; updateRoles: (roles: string[]) => void; } export const PipelineRoles = (props: IPipelineRolesConfigProps) => { const [allowedRoles, setAllowedRoles] = useState([]); useEffect(() => { setAllowedRoles(AuthenticationService.getAuthenticatedUser().roles); }, []); const onAllowedRolesChanged = (options: Array>) => { const roles = options.map((o) => o.value); props.updateRoles(roles); }; return (