mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 02:18:08 +08:00
chore(web): new lint setup (#30020)
Co-authored-by: yyh <yuanyouhuilyz@gmail.com>
This commit is contained in:
@ -1,18 +1,18 @@
|
||||
'use client'
|
||||
|
||||
import { useCallback, useMemo } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useParams, useRouter } from 'next/navigation'
|
||||
import type { NavItem } from '../nav/nav-selector'
|
||||
import type { DataSet } from '@/models/datasets'
|
||||
import {
|
||||
RiBook2Fill,
|
||||
RiBook2Line,
|
||||
} from '@remixicon/react'
|
||||
import { flatten } from 'lodash-es'
|
||||
import Nav from '../nav'
|
||||
import type { NavItem } from '../nav/nav-selector'
|
||||
import { basePath } from '@/utils/var'
|
||||
import { useParams, useRouter } from 'next/navigation'
|
||||
import { useCallback, useMemo } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useDatasetDetail, useDatasetList } from '@/service/knowledge/use-dataset'
|
||||
import type { DataSet } from '@/models/datasets'
|
||||
import { basePath } from '@/utils/var'
|
||||
import Nav from '../nav'
|
||||
|
||||
const DatasetNav = () => {
|
||||
const { t } = useTranslation()
|
||||
@ -30,7 +30,8 @@ const DatasetNav = () => {
|
||||
const datasetItems = flatten(datasetList?.pages.map(datasetData => datasetData.data))
|
||||
|
||||
const curNav = useMemo(() => {
|
||||
if (!currentDataset) return
|
||||
if (!currentDataset)
|
||||
return
|
||||
return {
|
||||
id: currentDataset.id,
|
||||
name: currentDataset.name,
|
||||
@ -82,11 +83,11 @@ const DatasetNav = () => {
|
||||
return (
|
||||
<Nav
|
||||
isApp={false}
|
||||
icon={<RiBook2Line className='h-4 w-4' />}
|
||||
activeIcon={<RiBook2Fill className='h-4 w-4' />}
|
||||
icon={<RiBook2Line className="h-4 w-4" />}
|
||||
activeIcon={<RiBook2Fill className="h-4 w-4" />}
|
||||
text={t('common.menus.datasets')}
|
||||
activeSegment='datasets'
|
||||
link='/datasets'
|
||||
activeSegment="datasets"
|
||||
link="/datasets"
|
||||
curNav={curNav}
|
||||
navigationItems={navigationItems}
|
||||
createText={t('common.menus.newDataset')}
|
||||
|
||||
Reference in New Issue
Block a user