import { css } from '@emotion/css'; import React from 'react'; import { dateTimeFormat, GrafanaTheme2, OrgRole, TimeZone } from '@grafana/data'; import { useStyles2 } from '@grafana/ui'; import { contextSrv } from 'app/core/core'; import { AccessControlAction, Role, ServiceAccountDTO } from 'app/types'; import { ServiceAccountProfileRow } from './ServiceAccountProfileRow'; import { ServiceAccountRoleRow } from './ServiceAccountRoleRow'; interface Props { serviceAccount: ServiceAccountDTO; timeZone: TimeZone; roleOptions: Role[]; onChange: (serviceAccount: ServiceAccountDTO) => void; } export function ServiceAccountProfile({ serviceAccount, timeZone, roleOptions, onChange }: Props): JSX.Element { const styles = useStyles2(getStyles); const ableToWrite = contextSrv.hasPermission(AccessControlAction.ServiceAccountsWrite); const onRoleChange = (role: OrgRole) => { onChange({ ...serviceAccount, role: role }); }; const onNameChange = (newValue: string) => { onChange({ ...serviceAccount, name: newValue }); }; return (

Information

); } export const getStyles = (theme: GrafanaTheme2) => ({ section: css` margin-bottom: ${theme.spacing(4)}; `, });