mirror of
https://github.com/langgenius/dify.git
synced 2026-04-27 02:36:29 +08:00
feat: filter title
This commit is contained in:
parent
176d810c8d
commit
84b2913cd9
@ -23,6 +23,7 @@ import {
|
|||||||
import { useImportDSL } from '@/hooks/use-import-dsl'
|
import { useImportDSL } from '@/hooks/use-import-dsl'
|
||||||
import DSLConfirmModal from '@/app/components/app/create-from-dsl-modal/dsl-confirm-modal'
|
import DSLConfirmModal from '@/app/components/app/create-from-dsl-modal/dsl-confirm-modal'
|
||||||
import Banner from '../banner'
|
import Banner from '../banner'
|
||||||
|
import Button from '../../base/button'
|
||||||
|
|
||||||
type AppsProps = {
|
type AppsProps = {
|
||||||
onSuccess?: () => void
|
onSuccess?: () => void
|
||||||
@ -43,6 +44,12 @@ const Apps = ({
|
|||||||
const [keywords, setKeywords] = useState('')
|
const [keywords, setKeywords] = useState('')
|
||||||
const [searchKeywords, setSearchKeywords] = useState('')
|
const [searchKeywords, setSearchKeywords] = useState('')
|
||||||
|
|
||||||
|
const hasFilterCondition = !!keywords
|
||||||
|
const handleResetFilter = useCallback(() => {
|
||||||
|
setKeywords('')
|
||||||
|
setSearchKeywords('')
|
||||||
|
}, [])
|
||||||
|
|
||||||
const { run: handleSearch } = useDebounceFn(() => {
|
const { run: handleSearch } = useDebounceFn(() => {
|
||||||
setSearchKeywords(keywords)
|
setSearchKeywords(keywords)
|
||||||
}, { wait: 500 })
|
}, { wait: 500 })
|
||||||
@ -150,7 +157,15 @@ const Apps = ({
|
|||||||
<div className={cn(
|
<div className={cn(
|
||||||
'mt-6 flex items-center justify-between px-12',
|
'mt-6 flex items-center justify-between px-12',
|
||||||
)}>
|
)}>
|
||||||
<div className={'system-xl-semibold grow truncate text-text-primary'}>{t('explore.apps.title')}</div>
|
<div className='flex items-center'>
|
||||||
|
<div className={'system-xl-semibold grow truncate text-text-primary'}>{!hasFilterCondition ? t('explore.apps.title') : t('explore.apps.resultNum', { num: searchFilteredList.length })}</div>
|
||||||
|
{hasFilterCondition && (
|
||||||
|
<>
|
||||||
|
<div className='mx-3 h-4 w-px bg-divider-regular'></div>
|
||||||
|
<Button size='medium' onClick={handleResetFilter}>{t('explore.apps.resetFilter')}</Button>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
<Input
|
<Input
|
||||||
showLeftIcon
|
showLeftIcon
|
||||||
showClearIcon
|
showClearIcon
|
||||||
|
|||||||
@ -18,6 +18,8 @@ const translation = {
|
|||||||
apps: {
|
apps: {
|
||||||
title: 'Try Dify\'s curated apps to find AI solutions for your business',
|
title: 'Try Dify\'s curated apps to find AI solutions for your business',
|
||||||
allCategories: 'All',
|
allCategories: 'All',
|
||||||
|
resultNum: '{{num}} results',
|
||||||
|
resetFilter: 'Clear filter',
|
||||||
},
|
},
|
||||||
appCard: {
|
appCard: {
|
||||||
addToWorkspace: 'Add to Workspace',
|
addToWorkspace: 'Add to Workspace',
|
||||||
|
|||||||
@ -18,6 +18,8 @@ const translation = {
|
|||||||
apps: {
|
apps: {
|
||||||
title: 'Difyの厳選アプリを試して、ビジネス向けのAIソリューションを見つけましょう',
|
title: 'Difyの厳選アプリを試して、ビジネス向けのAIソリューションを見つけましょう',
|
||||||
allCategories: '全て',
|
allCategories: '全て',
|
||||||
|
resultNum: '{{num}}件の結果',
|
||||||
|
resetFilter: 'クリア',
|
||||||
},
|
},
|
||||||
appCard: {
|
appCard: {
|
||||||
addToWorkspace: 'ワークスペースに追加',
|
addToWorkspace: 'ワークスペースに追加',
|
||||||
|
|||||||
@ -18,6 +18,8 @@ const translation = {
|
|||||||
apps: {
|
apps: {
|
||||||
title: '试用 Dify 精选示例应用,为您的业务寻找 AI 解决方案',
|
title: '试用 Dify 精选示例应用,为您的业务寻找 AI 解决方案',
|
||||||
allCategories: '所有',
|
allCategories: '所有',
|
||||||
|
resultNum: '{{num}} 个结果',
|
||||||
|
resetFilter: '清除筛选',
|
||||||
},
|
},
|
||||||
appCard: {
|
appCard: {
|
||||||
addToWorkspace: '添加到工作区',
|
addToWorkspace: '添加到工作区',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user