♻️ refactor(web): migrate React modules from .js to .jsx and align entrypoint
- Rename React components/pages/utilities that contain JSX to `.jsx` across `web/src` - Update import paths and re-exports to match new `.jsx` extensions - Fix Vite entry by switching `web/index.html` from `/src/index.js` to `/src/index.jsx` - Verified remaining `.js` files are plain JS (hooks/helpers/constants) and do not require JSX - No runtime behavior changes; extension and reference alignment only Context: Resolves the Vite pre-transform error caused by the stale `/src/index.js` entry after migrating to `.jsx`.
This commit is contained in:
@@ -23,22 +23,22 @@ import { useTranslation } from 'react-i18next';
|
||||
import { Layout, Toast, Modal } from '@douyinfe/semi-ui';
|
||||
|
||||
// Context
|
||||
import { UserContext } from '../../context/User/index.js';
|
||||
import { useIsMobile } from '../../hooks/common/useIsMobile.js';
|
||||
import { UserContext } from '../../context/User';
|
||||
import { useIsMobile } from '../../hooks/common/useIsMobile';
|
||||
|
||||
// hooks
|
||||
import { usePlaygroundState } from '../../hooks/playground/usePlaygroundState.js';
|
||||
import { useMessageActions } from '../../hooks/playground/useMessageActions.js';
|
||||
import { useApiRequest } from '../../hooks/playground/useApiRequest.js';
|
||||
import { useSyncMessageAndCustomBody } from '../../hooks/playground/useSyncMessageAndCustomBody.js';
|
||||
import { useMessageEdit } from '../../hooks/playground/useMessageEdit.js';
|
||||
import { useDataLoader } from '../../hooks/playground/useDataLoader.js';
|
||||
import { usePlaygroundState } from '../../hooks/playground/usePlaygroundState';
|
||||
import { useMessageActions } from '../../hooks/playground/useMessageActions';
|
||||
import { useApiRequest } from '../../hooks/playground/useApiRequest';
|
||||
import { useSyncMessageAndCustomBody } from '../../hooks/playground/useSyncMessageAndCustomBody';
|
||||
import { useMessageEdit } from '../../hooks/playground/useMessageEdit';
|
||||
import { useDataLoader } from '../../hooks/playground/useDataLoader';
|
||||
|
||||
// Constants and utils
|
||||
import {
|
||||
MESSAGE_ROLES,
|
||||
ERROR_MESSAGES
|
||||
} from '../../constants/playground.constants.js';
|
||||
} from '../../constants/playground.constants';
|
||||
import {
|
||||
getLogo,
|
||||
stringToColor,
|
||||
@@ -55,9 +55,9 @@ import {
|
||||
OptimizedDebugPanel,
|
||||
OptimizedMessageContent,
|
||||
OptimizedMessageActions
|
||||
} from '../../components/playground/OptimizedComponents.js';
|
||||
import ChatArea from '../../components/playground/ChatArea.js';
|
||||
import FloatingButtons from '../../components/playground/FloatingButtons.js';
|
||||
} from '../../components/playground/OptimizedComponents';
|
||||
import ChatArea from '../../components/playground/ChatArea';
|
||||
import FloatingButtons from '../../components/playground/FloatingButtons';
|
||||
|
||||
// 生成头像
|
||||
const generateAvatarDataUrl = (username) => {
|
||||
Reference in New Issue
Block a user