mirror of
https://github.com/logto-io/logto.git
synced 2025-01-27 21:39:16 -05:00
fix(console): fix connector platform label i18n (#1347)
This commit is contained in:
parent
f6bf53bd8e
commit
b18388ce57
1 changed files with 4 additions and 1 deletions
|
@ -1,9 +1,11 @@
|
|||
import { ConnectorDTO } from '@logto/schemas';
|
||||
import classNames from 'classnames';
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Link } from 'react-router-dom';
|
||||
import useSWR from 'swr';
|
||||
|
||||
import { connectorPlatformLabel } from '@/consts';
|
||||
import ConnectorPlatformIcon from '@/icons/ConnectorPlatformIcon';
|
||||
|
||||
import * as styles from './index.module.scss';
|
||||
|
@ -14,6 +16,7 @@ type Props = {
|
|||
};
|
||||
|
||||
const ConnectorTabs = ({ target, connectorId }: Props) => {
|
||||
const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' });
|
||||
const { data } = useSWR<ConnectorDTO[]>(`/api/connectors?target=${target}`);
|
||||
|
||||
if (!data) {
|
||||
|
@ -35,7 +38,7 @@ const ConnectorTabs = ({ target, connectorId }: Props) => {
|
|||
<ConnectorPlatformIcon platform={connector.platform} />
|
||||
</div>
|
||||
)}
|
||||
{connector.platform}
|
||||
{connector.platform && t(connectorPlatformLabel[connector.platform])}
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue