mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-10 03:16:51 +08:00
chore: perfect type definition (#1003)
This commit is contained in:
@@ -4,14 +4,15 @@ import React from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import cn from 'classnames'
|
||||
import exploreI18n from '@/i18n/lang/explore.en'
|
||||
import type { AppCategory } from '@/models/explore'
|
||||
|
||||
const categoryI18n = exploreI18n.category
|
||||
|
||||
export type ICategoryProps = {
|
||||
className?: string
|
||||
list: string[]
|
||||
list: AppCategory[]
|
||||
value: string
|
||||
onChange: (value: string) => void
|
||||
onChange: (value: AppCategory | '') => void
|
||||
}
|
||||
|
||||
const Category: FC<ICategoryProps> = ({
|
||||
@@ -40,7 +41,7 @@ const Category: FC<ICategoryProps> = ({
|
||||
style={itemStyle(name === value)}
|
||||
onClick={() => onChange(name)}
|
||||
>
|
||||
{(categoryI18n as any)[name] ? t(`explore.category.${name}`) : name}
|
||||
{categoryI18n[name] ? t(`explore.category.${name}`) : name}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user