Files
grafana/public/app/features/admin/ldap/LdapUserMappingInfo.tsx
Hugo Häggmark 20c700dd52 Chore: reduces barrel files part II (#107688)
* Chore: reduce barrel files

* chore: fixes unit test

* Chore: reduces barrel files part II

* chore: fix import sorting
2025-07-09 06:15:33 +02:00

57 lines
1.2 KiB
TypeScript

import { useMemo } from 'react';
import { InteractiveTable } from '@grafana/ui';
import { LdapUserInfo } from 'app/types/ldap';
interface Props {
info: LdapUserInfo;
}
export const LdapUserMappingInfo = ({ info }: Props) => {
const columns = useMemo(
() => [
{
id: 'userInfo',
header: 'User Information',
disableGrow: true,
},
{
id: 'ldapValue',
},
{
id: 'cfgAttrValue',
header: 'LDAP attribute',
},
],
[]
);
const rows = useMemo(
() => [
{
userInfo: 'First name',
ldapValue: info.name.ldapValue,
cfgAttrValue: info.name.cfgAttrValue,
},
{
userInfo: 'Surname',
ldapValue: info.surname.ldapValue,
cfgAttrValue: info.surname.cfgAttrValue,
},
{
userInfo: 'Username',
ldapValue: info.login.ldapValue,
cfgAttrValue: info.login.cfgAttrValue,
},
{
userInfo: 'Email',
ldapValue: info.email.ldapValue,
cfgAttrValue: info.email.cfgAttrValue,
},
],
[info]
);
return <InteractiveTable columns={columns} data={rows} getRowId={(row) => row.userInfo} />;
};