Skip to content

Commit

Permalink
Update ApiMenu.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
AthanaD authored Dec 30, 2023
1 parent d0b316e commit 57ed41e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/ApiMenu/ApiMenu.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -32,7 +32,7 @@ const ApiMenu = ({ setIsModalOpen }: { setIsModalOpen: React.Dispatch<React.SetS
_setCustomEndpoint(prev => !prev);
};

const preventCopy = (e) => {
const preventCopy = (e: React.ClipboardEvent<HTMLInputElement>) => { // 明确指定e的类型
e.preventDefault();
alert("Copying API key is not allowed.");
};
Expand Down Expand Up @@ -60,7 +60,7 @@ const ApiMenu = ({ setIsModalOpen }: { setIsModalOpen: React.Dispatch<React.SetS
</div>
{_customEndpoint ? (
<input
type='password'
type='text'
className='text-gray-800 dark:text-white p-3 text-sm border-none bg-gray-200 dark:bg-gray-600 rounded-md m-0 w-full mr-0 h-8 focus:outline-none'
value={_apiEndpoint}
onChange={(e) => _setApiEndpoint(e.target.value)}
Expand Down Expand Up @@ -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 => (
<li
className='px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white cursor-pointer truncate'
onClick={() => {
Expand Down

0 comments on commit 57ed41e

Please sign in to comment.