0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-23 20:33:16 -05:00
logto/packages/console/src/consts/connectors.ts

61 lines
1.8 KiB
TypeScript
Raw Normal View History

2022-10-21 00:14:17 -05:00
import type { AdminConsoleKey } from '@logto/phrases';
import { ConnectorPlatform, ConnectorType } from '@logto/schemas';
import EmailConnector from '@/assets/icons/connector-email.svg';
import SmsConnectorIcon from '@/assets/icons/connector-sms.svg';
import type { ConnectorGroup } from '@/types/connector';
type TitlePlaceHolder = {
[key in ConnectorType]: AdminConsoleKey;
};
2023-04-21 11:55:17 -05:00
export const connectorTitlePlaceHolder = Object.freeze({
[ConnectorType.Sms]: 'connectors.type.sms',
[ConnectorType.Email]: 'connectors.type.email',
[ConnectorType.Social]: 'connectors.type.social',
2023-04-21 11:55:17 -05:00
}) satisfies TitlePlaceHolder;
type ConnectorPlatformLabel = {
[key in ConnectorPlatform]: AdminConsoleKey;
};
2023-04-21 11:55:17 -05:00
export const connectorPlatformLabel = Object.freeze({
[ConnectorPlatform.Native]: 'connectors.platform.native',
[ConnectorPlatform.Universal]: 'connectors.platform.universal',
[ConnectorPlatform.Web]: 'connectors.platform.web',
2023-04-21 11:55:17 -05:00
}) satisfies ConnectorPlatformLabel;
type ConnectorPlaceholderIcon = {
[key in ConnectorType]?: SvgComponent;
};
export const connectorPlaceholderIcon: ConnectorPlaceholderIcon = Object.freeze({
[ConnectorType.Sms]: SmsConnectorIcon,
[ConnectorType.Email]: EmailConnector,
2023-04-21 11:55:17 -05:00
});
export const defaultSmsConnectorGroup: ConnectorGroup = {
id: 'default-sms-connector',
type: ConnectorType.Sms,
connectors: [],
name: { en: '' },
description: { en: '' },
logo: '',
logoDark: null,
target: '',
};
export const defaultEmailConnectorGroup: ConnectorGroup = {
id: 'default-email-connector',
type: ConnectorType.Email,
connectors: [],
name: { en: '' },
description: { en: '' },
logo: '',
logoDark: null,
target: '',
};
// Note: these connector targets will need a native connector to support the native platform
export const supportNativePlatformTargets = ['wechat', 'alipay'];