Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
warren830 committed Dec 23, 2024
1 parent 981643b commit e2c9038
Show file tree
Hide file tree
Showing 137 changed files with 1,068 additions and 1,053 deletions.
2 changes: 1 addition & 1 deletion web/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { StorybookConfig } from '@storybook/nextjs'
import type {StorybookConfig} from '@storybook/nextjs'

const config: StorybookConfig = {
// stories: ['../stories/**/*.mdx', '../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
Expand Down
4 changes: 2 additions & 2 deletions web/.storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import type { Preview } from '@storybook/react'
import { withThemeByDataAttribute } from '@storybook/addon-themes';
import type {Preview} from '@storybook/react'
import {withThemeByDataAttribute} from '@storybook/addon-themes';
import I18nServer from '../app/components/i18n-server'

import '../app/styles/globals.css'
Expand Down
16 changes: 8 additions & 8 deletions web/app/account/account-page/index.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
'use client'
import { useState } from 'react'
import { useTranslation } from 'react-i18next'
import {useState} from 'react'
import {useTranslation} from 'react-i18next'

import { useContext } from 'use-context-selector'
import {useContext} from 'use-context-selector'
import s from './index.module.css'
import type {IItem} from '@/app/components/header/account-setting/collapse'
import Collapse from '@/app/components/header/account-setting/collapse'
import type { IItem } from '@/app/components/header/account-setting/collapse'
import Modal from '@/app/components/base/modal'
import Confirm from '@/app/components/base/confirm'
import Button from '@/app/components/base/button'
import { updateUserProfile } from '@/service/common'
import { useAppContext } from '@/context/app-context'
import { ToastContext } from '@/app/components/base/toast'
import {updateUserProfile} from '@/service/common'
import {useAppContext} from '@/context/app-context'
import {ToastContext} from '@/app/components/base/toast'
import AppIcon from '@/app/components/base/app-icon'
import Avatar from '@/app/components/base/avatar'
import { IS_CE_EDITION } from '@/config'
import {IS_CE_EDITION} from '@/config'
import Input from '@/app/components/base/input'

const titleClassName = `
Expand Down
14 changes: 7 additions & 7 deletions web/app/account/avatar.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
'use client'
import { useTranslation } from 'react-i18next'
import { Fragment } from 'react'
import { useRouter } from 'next/navigation'
import { Menu, Transition } from '@headlessui/react'
import {useTranslation} from 'react-i18next'
import {Fragment} from 'react'
import {useRouter} from 'next/navigation'
import {Menu, Transition} from '@headlessui/react'
import Avatar from '@/app/components/base/avatar'
import { logout } from '@/service/common'
import { useAppContext } from '@/context/app-context'
import { LogOut01 } from '@/app/components/base/icons/src/vender/line/general'
import {logout} from '@/service/common'
import {useAppContext} from '@/context/app-context'
import {LogOut01} from '@/app/components/base/icons/src/vender/line/general'

export type IAppSelector = {
isMobile: boolean
Expand Down
6 changes: 3 additions & 3 deletions web/app/account/header.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'
import { useTranslation } from 'react-i18next'
import { RiArrowRightUpLine, RiRobot2Line } from '@remixicon/react'
import { useRouter } from 'next/navigation'
import {useTranslation} from 'react-i18next'
import {RiArrowRightUpLine, RiRobot2Line} from '@remixicon/react'
import {useRouter} from 'next/navigation'
import Button from '../components/base/button'
import Avatar from './avatar'
import LogoSite from '@/app/components/base/logo/logo-site'
Expand Down
12 changes: 6 additions & 6 deletions web/app/account/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type {ReactNode} from 'react'
import React from 'react'
import type { ReactNode } from 'react'
import Header from './header'
import SwrInitor from '@/app/components/swr-initor'
import { AppContextProvider } from '@/context/app-context'
import GA, { GaType } from '@/app/components/base/ga'
import {AppContextProvider} from '@/context/app-context'
import GA, {GaType} from '@/app/components/base/ga'
import HeaderWrapper from '@/app/components/header/header-wrapper'
import { EventEmitterContextProvider } from '@/context/event-emitter'
import { ProviderContextProvider } from '@/context/provider-context'
import { ModalContextProvider } from '@/context/modal-context'
import {EventEmitterContextProvider} from '@/context/event-emitter'
import {ProviderContextProvider} from '@/context/provider-context'
import {ModalContextProvider} from '@/context/modal-context'

const Layout = ({ children }: { children: ReactNode }) => {
return (
Expand Down
6 changes: 3 additions & 3 deletions web/app/activate/activateForm.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use client'
import { useTranslation } from 'react-i18next'
import {useTranslation} from 'react-i18next'
import useSWR from 'swr'
import { useRouter, useSearchParams } from 'next/navigation'
import {useRouter, useSearchParams} from 'next/navigation'
import cn from '@/utils/classnames'
import Button from '@/app/components/base/button'

import { invitationCheck } from '@/service/common'
import {invitationCheck} from '@/service/common'
import Loading from '@/app/components/base/loading'

const ActivateForm = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use client'
import type { FC } from 'react'
import type {FC} from 'react'
import React from 'react'
import { useTranslation } from 'react-i18next'
import {useTranslation} from 'react-i18next'
import Textarea from '@/app/components/base/textarea'
import { Robot, User } from '@/app/components/base/icons/src/public/avatar'
import {Robot, User} from '@/app/components/base/icons/src/public/avatar'

export enum EditItemType {
Query = 'query',
Expand Down
13 changes: 7 additions & 6 deletions web/app/components/app/annotation/add-annotation-modal/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
'use client'
import type { FC } from 'react'
import React, { useState } from 'react'
import { useTranslation } from 'react-i18next'
import type { AnnotationItemBasic } from '../type'
import EditItem, { EditItemType } from './edit-item'
import type {FC} from 'react'
import React, {useState} from 'react'
import {useTranslation} from 'react-i18next'
import type {AnnotationItemBasic} from '../type'
import EditItem, {EditItemType} from './edit-item'
import Checkbox from '@/app/components/base/checkbox'
import Drawer from '@/app/components/base/drawer-plus'
import Button from '@/app/components/base/button'
import Toast from '@/app/components/base/toast'
import { useProviderContext } from '@/context/provider-context'
import {useProviderContext} from '@/context/provider-context'
import AnnotationFull from '@/app/components/billing/annotation-full'

type Props = {
isShow: boolean
onHide: () => void
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
'use client'
import type { FC } from 'react'
import type {FC} from 'react'
import React from 'react'
import {
useCSVDownloader,
} from 'react-papaparse'
import { useTranslation } from 'react-i18next'
import { useContext } from 'use-context-selector'
import { Download02 as DownloadIcon } from '@/app/components/base/icons/src/vender/solid/general'
import {useCSVDownloader,} from 'react-papaparse'
import {useTranslation} from 'react-i18next'
import {useContext} from 'use-context-selector'
import {Download02 as DownloadIcon} from '@/app/components/base/icons/src/vender/solid/general'
import I18n from '@/context/i18n'
import { LanguagesSupported } from '@/i18n/language'
import {LanguagesSupported} from '@/i18n/language'

const CSV_TEMPLATE_QA_EN = [
['question', 'answer'],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
'use client'
import type { FC } from 'react'
import React, { useEffect, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { useContext } from 'use-context-selector'
import { RiDeleteBinLine } from '@remixicon/react'
import type {FC} from 'react'
import React, {useEffect, useRef, useState} from 'react'
import {useTranslation} from 'react-i18next'
import {useContext} from 'use-context-selector'
import {RiDeleteBinLine} from '@remixicon/react'
import cn from '@/utils/classnames'
import { Csv as CSVIcon } from '@/app/components/base/icons/src/public/files'
import { ToastContext } from '@/app/components/base/toast'
import {Csv as CSVIcon} from '@/app/components/base/icons/src/public/files'
import {ToastContext} from '@/app/components/base/toast'
import Button from '@/app/components/base/button'

export type Props = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
'use client'
import type { FC } from 'react'
import React, { useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { RiCloseLine } from '@remixicon/react'
import type {FC} from 'react'
import React, {useEffect, useState} from 'react'
import {useTranslation} from 'react-i18next'
import {RiCloseLine} from '@remixicon/react'
import CSVUploader from './csv-uploader'
import CSVDownloader from './csv-downloader'
import Button from '@/app/components/base/button'
import Modal from '@/app/components/base/modal'
import Toast from '@/app/components/base/toast'
import { annotationBatchImport, checkAnnotationBatchImportProgress } from '@/service/annotation'
import { useProviderContext } from '@/context/provider-context'
import {annotationBatchImport, checkAnnotationBatchImportProgress} from '@/service/annotation'
import {useProviderContext} from '@/context/provider-context'
import AnnotationFull from '@/app/components/billing/annotation-full'

export enum ProcessStatus {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use client'
import type { FC } from 'react'
import React, { useState } from 'react'
import { useTranslation } from 'react-i18next'
import { RiDeleteBinLine, RiEditFill, RiEditLine } from '@remixicon/react'
import { Robot, User } from '@/app/components/base/icons/src/public/avatar'
import type {FC} from 'react'
import React, {useState} from 'react'
import {useTranslation} from 'react-i18next'
import {RiDeleteBinLine, RiEditFill, RiEditLine} from '@remixicon/react'
import {Robot, User} from '@/app/components/base/icons/src/public/avatar'
import Textarea from '@/app/components/base/textarea'
import Button from '@/app/components/base/button'
import cn from '@/utils/classnames'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
'use client'
import type { FC } from 'react'
import React, { useState } from 'react'
import { useTranslation } from 'react-i18next'
import EditItem, { EditItemType } from './edit-item'
import type {FC} from 'react'
import React, {useState} from 'react'
import {useTranslation} from 'react-i18next'
import EditItem, {EditItemType} from './edit-item'
import Drawer from '@/app/components/base/drawer-plus'
import { MessageCheckRemove } from '@/app/components/base/icons/src/vender/line/communication'
import {MessageCheckRemove} from '@/app/components/base/icons/src/vender/line/communication'
import Confirm from '@/app/components/base/confirm'
import { addAnnotation, editAnnotation } from '@/service/annotation'
import {addAnnotation, editAnnotation} from '@/service/annotation'
import Toast from '@/app/components/base/toast'
import { useProviderContext } from '@/context/provider-context'
import {useProviderContext} from '@/context/provider-context'
import AnnotationFull from '@/app/components/billing/annotation-full'
import useTimestamp from '@/hooks/use-timestamp'

Expand Down
4 changes: 2 additions & 2 deletions web/app/components/app/annotation/empty-element.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'
import type { FC, SVGProps } from 'react'
import type {FC, SVGProps} from 'react'
import React from 'react'
import { useTranslation } from 'react-i18next'
import {useTranslation} from 'react-i18next'

const ThreeDotsIcon = ({ className }: SVGProps<SVGElement>) => {
return <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" className={className ?? ''}>
Expand Down
6 changes: 3 additions & 3 deletions web/app/components/app/annotation/filter.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use client'
import type { FC } from 'react'
import type {FC} from 'react'
import React from 'react'
import { useTranslation } from 'react-i18next'
import {useTranslation} from 'react-i18next'
import useSWR from 'swr'
import Input from '@/app/components/base/input'
import { fetchAnnotationsCount } from '@/service/log'
import {fetchAnnotationsCount} from '@/service/log'

export type QueryParam = {
keyword?: string
Expand Down
29 changes: 12 additions & 17 deletions web/app/components/app/annotation/header-opts/index.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,23 @@
'use client'
import type { FC } from 'react'
import React, { Fragment, useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'
import {
RiAddLine,
RiMoreFill,
} from '@remixicon/react'
import { useContext } from 'use-context-selector'
import {
useCSVDownloader,
} from 'react-papaparse'
import { Menu, Transition } from '@headlessui/react'
import type {FC} from 'react'
import React, {Fragment, useEffect, useState} from 'react'
import {useTranslation} from 'react-i18next'
import {RiAddLine, RiMoreFill,} from '@remixicon/react'
import {useContext} from 'use-context-selector'
import {useCSVDownloader,} from 'react-papaparse'
import {Menu, Transition} from '@headlessui/react'
import Button from '../../../base/button'
import AddAnnotationModal from '../add-annotation-modal'
import type { AnnotationItemBasic } from '../type'
import type {AnnotationItemBasic} from '../type'
import BatchAddModal from '../batch-add-annotation-modal'
import cn from '@/utils/classnames'
import CustomPopover from '@/app/components/base/popover'
import { FileDownload02, FilePlus02 } from '@/app/components/base/icons/src/vender/line/files'
import { ChevronRight } from '@/app/components/base/icons/src/vender/line/arrows'
import {FileDownload02, FilePlus02} from '@/app/components/base/icons/src/vender/line/files'
import {ChevronRight} from '@/app/components/base/icons/src/vender/line/arrows'

import I18n from '@/context/i18n'
import { fetchExportAnnotationList } from '@/service/annotation'
import { LanguagesSupported } from '@/i18n/language'
import {fetchExportAnnotationList} from '@/service/annotation'
import {LanguagesSupported} from '@/i18n/language'

const CSV_HEADER_QA_EN = ['Question', 'Answer']
const CSV_HEADER_QA_CN = ['问题', '答案']
Expand Down
37 changes: 23 additions & 14 deletions web/app/components/app/annotation/index.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,39 @@
'use client'
import type { FC } from 'react'
import React, { useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { useDebounce } from 'ahooks'
import { RiEqualizer2Line } from '@remixicon/react'
import type {FC} from 'react'
import React, {useEffect, useState} from 'react'
import {useTranslation} from 'react-i18next'
import {useDebounce} from 'ahooks'
import {RiEqualizer2Line} from '@remixicon/react'
import Toast from '../../base/toast'
import type {QueryParam} from './filter'
import Filter from './filter'
import type { QueryParam } from './filter'
import List from './list'
import EmptyElement from './empty-element'
import HeaderOpts from './header-opts'
import { AnnotationEnableStatus, type AnnotationItem, type AnnotationItemBasic, JobStatus } from './type'
import {AnnotationEnableStatus, type AnnotationItem, type AnnotationItemBasic, JobStatus} from './type'
import ViewAnnotationModal from './view-annotation-modal'
import { MessageFast } from '@/app/components/base/icons/src/vender/solid/communication'
import {MessageFast} from '@/app/components/base/icons/src/vender/solid/communication'
import ActionButton from '@/app/components/base/action-button'
import Pagination from '@/app/components/base/pagination'
import Switch from '@/app/components/base/switch'
import { addAnnotation, delAnnotation, fetchAnnotationConfig as doFetchAnnotationConfig, editAnnotation, fetchAnnotationList, queryAnnotationJobStatus, updateAnnotationScore, updateAnnotationStatus } from '@/service/annotation'
import {
addAnnotation,
delAnnotation,
editAnnotation,
fetchAnnotationConfig as doFetchAnnotationConfig,
fetchAnnotationList,
queryAnnotationJobStatus,
updateAnnotationScore,
updateAnnotationStatus
} from '@/service/annotation'
import Loading from '@/app/components/base/loading'
import { APP_PAGE_LIMIT } from '@/config'
import {APP_PAGE_LIMIT} from '@/config'
import ConfigParamModal from '@/app/components/base/features/new-feature-panel/annotation-reply/config-param-modal'
import type { AnnotationReplyConfig } from '@/models/debug'
import { sleep } from '@/utils'
import { useProviderContext } from '@/context/provider-context'
import type {AnnotationReplyConfig} from '@/models/debug'
import {sleep} from '@/utils'
import {useProviderContext} from '@/context/provider-context'
import AnnotationFullModal from '@/app/components/billing/annotation-full/modal'
import type { App } from '@/types/app'
import type {App} from '@/types/app'
import cn from '@/utils/classnames'

type Props = {
Expand Down
8 changes: 4 additions & 4 deletions web/app/components/app/annotation/list.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use client'
import type { FC } from 'react'
import type {FC} from 'react'
import React from 'react'
import { useTranslation } from 'react-i18next'
import { RiDeleteBinLine, RiEditLine } from '@remixicon/react'
import type { AnnotationItem } from './type'
import {useTranslation} from 'react-i18next'
import {RiDeleteBinLine, RiEditLine} from '@remixicon/react'
import type {AnnotationItem} from './type'
import RemoveAnnotationConfirmModal from './remove-annotation-confirm-modal'
import ActionButton from '@/app/components/base/action-button'
import useTimestamp from '@/hooks/use-timestamp'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'
import type { FC } from 'react'
import type {FC} from 'react'
import React from 'react'
import { useTranslation } from 'react-i18next'
import {useTranslation} from 'react-i18next'
import Confirm from '@/app/components/base/confirm'

type Props = {
Expand Down
Loading

0 comments on commit e2c9038

Please sign in to comment.