feat: prototype of endpoint setting

This commit is contained in:
Wentao Lyu 2023-03-31 23:15:38 +08:00
parent b703d3706b
commit 462660d554
5 changed files with 64 additions and 11 deletions

View file

@ -3,8 +3,8 @@ import React from 'react';
import EditIcon from '../svg/EditIcon';
export default function HoverButtons({ visible, onClick, endpoint }) {
const enabled = endpoint in ['azureOpenAI', 'openAI', 'chatGPTBrowser'];
const enabled = !!['azureOpenAI', 'openAI', 'chatGPTBrowser'].find(e => e === endpoint);
console.log(enabled);
return (
<div className="visible mt-2 flex justify-center gap-3 self-end text-gray-400 md:gap-4 lg:absolute lg:top-0 lg:right-0 lg:mt-0 lg:translate-x-full lg:gap-1 lg:self-center lg:pl-2">
{visible && enabled ? (