Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

1.8 KB
Raw Blame
'use client';

import { createStaticStyles } from '@lobehub/ui';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';

import { densityVars } from '@/styles/densityVars';

import type { ChannelPlatformDefinition } from '../const';
import { getPlatformIcon } from '../const';

const styles = createStaticStyles(({ css, cssVar }) => ({
  desc: css`
    max-width: 360px;

    font-size: ${densityVars.fontSize};
    line-height: 1.6;
    color: ${cssVar.colorTextSecondary};
    text-align: center;
  `,
  main: css`
    position: relative;

    display: flex;
    flex: none;
    flex-direction: column;
    align-items: center;

    width: 100%;
    padding: 24px;

    background: ${cssVar.colorBgContainer};
  `,
  placeholder: css`
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: ${densityVars.sectionGap};
    align-items: center;
    justify-content: center;

    width: 100%;
    max-width: 1024px;
    padding-block: 48px;
  `,
  title: css`
    font-size: 18px;
    font-weight: 500;
    color: ${cssVar.colorText};
  `,
}));

interface ComingSoonDetailProps {
  platformDef: ChannelPlatformDefinition;
}

const ComingSoonDetail = memo<ComingSoonDetailProps>(({ platformDef }) => {
  const { t } = useTranslation('agent');
  const PlatformIcon = getPlatformIcon(platformDef.name);
  const ColorIcon =
    PlatformIcon && 'Color' in PlatformIcon ? (PlatformIcon as any).Color : PlatformIcon;

  return (
    <main className={styles.main}>
      <div className={styles.placeholder}>
        {ColorIcon && <ColorIcon size={64} />}
        <div className={styles.title}>
          {t('channel.comingSoonTitle', { name: platformDef.name })}
        </div>
        <div className={styles.desc}>{t('channel.comingSoonDesc')}</div>
      </div>
    </main>
  );
});

export default ComingSoonDetail;