import { CompoundButton, Link, Text } from '@fluentui/react-components'; import React, { FC, ReactElement } from 'react'; import banner from '../assets/images/banner.jpg'; import { Chat20Regular, ClipboardEdit20Regular, DataUsageSettings20Regular, DocumentSettings20Regular } from '@fluentui/react-icons'; import { useNavigate } from 'react-router'; import { observer } from 'mobx-react-lite'; import { RunButton } from '../components/RunButton'; import manifest from '../../../manifest.json'; import { BrowserOpenURL } from '../../wailsjs/runtime'; import { useTranslation } from 'react-i18next'; import { ConfigSelector } from '../components/ConfigSelector'; import MarkdownRender from '../components/MarkdownRender'; import commonStore from '../stores/commonStore'; import { Completion } from './Completion'; export type IntroductionContent = { [lang: string]: string } type NavCard = { label: string; desc: string; path: string; icon: ReactElement; }; const navCards: NavCard[] = [ { label: 'Chat', desc: 'Go to chat page', path: '/chat', icon: }, { label: 'Completion', desc: 'Writer, Translator, Role-playing', path: '/completion', icon: }, { label: 'Configs', desc: 'Manage your configs', path: '/configs', icon: }, { label: 'Models', desc: 'Manage models', path: '/models', icon: } ]; export const Home: FC = observer(() => { const { t } = useTranslation(); const navigate = useNavigate(); const lang: string = commonStore.settings.language; const onClickNavCard = (path: string) => { navigate({ pathname: path }); }; return (
{t('Introduction')}
{lang in commonStore.introduction ? commonStore.introduction[lang] : commonStore.introduction['en']}
{navCards.map(({ label, path, icon, desc }, index) => ( onClickNavCard(path)}> {t(label)} ))}
{t('Version')}: {manifest.version} BrowserOpenURL('https://github.com/josStorer/RWKV-Runner')}>{t('Help')}
); });