chore: lint code to remove unused imports and variables (#7033)

This commit is contained in:
DDDDD12138 2024-08-07 13:04:44 +08:00 committed by GitHub
parent 1a302ca957
commit 4c4f6e362f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 3 additions and 21 deletions

View File

@ -117,7 +117,6 @@ const Panel: FC = () => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
const [isFold, setFold] = useState(false)
const [controlShowPopup, setControlShowPopup] = useState<number>(0)
const showPopup = useCallback(() => {
setControlShowPopup(Date.now())

View File

@ -79,7 +79,7 @@ const EditItem: FC<Props> = ({
{!readonly && (
<div
className='flex items-center space-x-1 leading-[18px] text-xs font-medium text-[#155EEF] cursor-pointer'
onClick={(e) => {
onClick={() => {
setIsEdit(true)
}}
>

View File

@ -24,7 +24,7 @@ const ConfirmAddVar: FC<IConfirmAddVarProps> = ({
varNameArr,
onConfrim,
onCancel,
onHide,
// onHide,
}) => {
const { t } = useTranslation()
const mainContentRef = useRef<HTMLDivElement>(null)

View File

@ -69,7 +69,6 @@ const Prompt: FC<ISimplePromptInput> = ({
hasSetBlockStatus,
showSelectDataSet,
externalDataToolsConfig,
isAgent,
} = useContext(ConfigContext)
const { notify } = useToastContext()
const { setShowExternalDataToolModal } = useModalContext()

View File

@ -53,7 +53,7 @@ function AppCard({
}: IAppCardProps) {
const router = useRouter()
const pathname = usePathname()
const { currentWorkspace, isCurrentWorkspaceManager, isCurrentWorkspaceEditor } = useAppContext()
const { isCurrentWorkspaceManager, isCurrentWorkspaceEditor } = useAppContext()
const [showSettingsModal, setShowSettingsModal] = useState(false)
const [showEmbedded, setShowEmbedded] = useState(false)
const [showCustomizeModal, setShowCustomizeModal] = useState(false)

View File

@ -21,7 +21,6 @@ type ResultPanelProps = {
}
const ResultPanel: FC<ResultPanelProps> = ({
status,
elapsed_time,
total_tokens,
error,

View File

@ -49,8 +49,6 @@ const BlockInput: FC<IBlockInputProps> = ({
setCurrentValue(value)
}, [value])
const isContentChanged = value !== currentValue
const contentEditableRef = useRef<HTMLTextAreaElement>(null)
const [isEditing, setIsEditing] = useState<boolean>(false)
useEffect(() => {

View File

@ -1,14 +1,10 @@
'use client'
import type { FC } from 'react'
import React from 'react'
import { useContext } from 'use-context-selector'
import type { ThoughtItem, ToolInfoInThought } from '../type'
import Tool from '@/app/components/base/chat/chat/thought/tool'
import type { Emoji } from '@/app/components/tools/types'
import I18n from '@/context/i18n'
import { getLanguage } from '@/i18n/language'
export type IThoughtProps = {
thought: ThoughtItem
allToolIcons: Record<string, string | Emoji>
@ -31,9 +27,6 @@ const Thought: FC<IThoughtProps> = ({
allToolIcons,
isFinished,
}) => {
const { locale } = useContext(I18n)
const language = getLanguage(locale)
const [toolNames, isValueArray]: [string[], boolean] = (() => {
try {
if (Array.isArray(JSON.parse(thought.tool)))

View File

@ -6,13 +6,10 @@ import UpgradeBtn from '../upgrade-btn'
import VectorSpaceInfo from '../usage-info/vector-space-info'
import s from './style.module.css'
import cn from '@/utils/classnames'
import { useProviderContext } from '@/context/provider-context'
import GridMask from '@/app/components/base/grid-mask'
const VectorSpaceFull: FC = () => {
const { t } = useTranslation()
const { plan } = useProviderContext()
const { total } = plan
return (
<GridMask wrapperClassName='border border-gray-200 rounded-xl' canvasClassName='rounded-xl' gradientClassName='rounded-xl'>

View File

@ -1,4 +1,3 @@
import { useContext } from 'use-context-selector'
import { useTranslation } from 'react-i18next'
import Button from '../../base/button'
import Tag from '../../base/tag'
@ -6,7 +5,6 @@ import Tooltip from '../../base/tooltip'
import { getIcon } from '../common/retrieval-method-info'
import s from './style.module.css'
import cn from '@/utils/classnames'
import DatasetDetailContext from '@/context/dataset-detail'
import type { HitTestingResponse } from '@/models/datasets'
import { hitTesting } from '@/service/datasets'
import { asyncRunSafe } from '@/utils'
@ -40,7 +38,6 @@ const TextAreaWithButton = ({
onSubmit: _onSubmit,
}: TextAreaWithButtonIProps) => {
const { t } = useTranslation()
const { indexingTechnique } = useContext(DatasetDetailContext)
function handleTextChange(event: any) {
setText(event.target.value)