web: Add style CI workflow to enforce eslint checks on web module (#1910)
This commit is contained in:
parent
b4a170cb8a
commit
a798dcfae9
29 changed files with 141 additions and 102 deletions
|
|
@ -1,9 +1,9 @@
|
|||
'use client'
|
||||
import { useContext } from 'use-context-selector'
|
||||
import TemplateEn from './template/template.en.mdx'
|
||||
import TemplateZh from './template/template.zh.mdx'
|
||||
import TemplateChatEn from './template/template_chat.en.mdx'
|
||||
import TemplateChatZh from './template/template_chat.zh.mdx'
|
||||
import { useContext } from 'use-context-selector'
|
||||
import I18n from '@/context/i18n'
|
||||
|
||||
type IDocProps = {
|
||||
|
|
@ -14,20 +14,21 @@ const Doc = ({ appDetail }: IDocProps) => {
|
|||
const { locale } = useContext(I18n)
|
||||
const variables = appDetail?.model_config?.configs?.prompt_variables || []
|
||||
const inputs = variables.reduce((res: any, variable: any) => {
|
||||
res[variable.key] = variable.name || '';
|
||||
res[variable.key] = variable.name || ''
|
||||
return res
|
||||
}, {})
|
||||
|
||||
return (
|
||||
<article className="prose prose-xl" >
|
||||
{appDetail?.mode === 'completion' ? (
|
||||
locale === 'en' ? <TemplateEn appDetail={appDetail} variables={variables} inputs={inputs} /> : <TemplateZh appDetail={appDetail} variables={variables} inputs={inputs} />
|
||||
) : (
|
||||
locale === 'en' ? <TemplateChatEn appDetail={appDetail} variables={variables} inputs={inputs} /> : <TemplateChatZh appDetail={appDetail} variables={variables} inputs={inputs} />
|
||||
)}
|
||||
{appDetail?.mode === 'completion'
|
||||
? (
|
||||
locale === 'en' ? <TemplateEn appDetail={appDetail} variables={variables} inputs={inputs} /> : <TemplateZh appDetail={appDetail} variables={variables} inputs={inputs} />
|
||||
)
|
||||
: (
|
||||
locale === 'en' ? <TemplateChatEn appDetail={appDetail} variables={variables} inputs={inputs} /> : <TemplateChatZh appDetail={appDetail} variables={variables} inputs={inputs} />
|
||||
)}
|
||||
</article>
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
export default Doc
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue