From 57ed41e8c169386c22941c7c45da3a9ed02e4de9 Mon Sep 17 00:00:00 2001 From: DevinGlaw <125889247+pandoradevin@users.noreply.github.com> Date: Sat, 30 Dec 2023 22:35:22 +0800 Subject: [PATCH] Update ApiMenu.tsx --- src/components/ApiMenu/ApiMenu.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/ApiMenu/ApiMenu.tsx b/src/components/ApiMenu/ApiMenu.tsx index e97790a..79f6977 100644 --- a/src/components/ApiMenu/ApiMenu.tsx +++ b/src/components/ApiMenu/ApiMenu.tsx @@ -1,5 +1,5 @@ import React, { useState } from 'react'; -import { useTranslation } from 'react-i18next'; +import { useTranslation, Trans } from 'react-i18next'; // 确保从'react-i18next'导入了Trans import useStore from '@store/store'; import useHideOnOutsideClick from '@hooks/useHideOnOutsideClick'; import PopupModal from '@components/PopupModal'; @@ -32,7 +32,7 @@ const ApiMenu = ({ setIsModalOpen }: { setIsModalOpen: React.Dispatch !prev); }; - const preventCopy = (e) => { + const preventCopy = (e: React.ClipboardEvent) => { // 明确指定e的类型 e.preventDefault(); alert("Copying API key is not allowed."); }; @@ -60,7 +60,7 @@ const ApiMenu = ({ setIsModalOpen }: { setIsModalOpen: React.Dispatch {_customEndpoint ? ( _setApiEndpoint(e.target.value)} @@ -139,7 +139,7 @@ const ApiEndpointSelector = ({ className='text-sm text-gray-700 dark:text-gray-200 p-0 m-0' aria-labelledby='dropdownDefaultButton' > - {availableEndpoints.map((endpoint) => ( + {availableEndpoints.map(endpoint => (
  • {