feat: add in prettier and format code for consistency (#168)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { OpenAIModel } from "@/types";
|
||||
import { FC } from "react";
|
||||
import { useTranslation } from "next-i18next";
|
||||
import { OpenAIModel } from '@/types';
|
||||
import { FC } from 'react';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
|
||||
interface Props {
|
||||
model: OpenAIModel;
|
||||
@@ -9,23 +9,24 @@ interface Props {
|
||||
}
|
||||
|
||||
export const ModelSelect: FC<Props> = ({ model, models, onModelChange }) => {
|
||||
const {t} = useTranslation('chat')
|
||||
const { t } = useTranslation('chat');
|
||||
return (
|
||||
<div className="flex flex-col">
|
||||
<label className="text-left mb-2 dark:text-neutral-400 text-neutral-700">{t('Model')}</label>
|
||||
<label className="mb-2 text-left text-neutral-700 dark:text-neutral-400">
|
||||
{t('Model')}
|
||||
</label>
|
||||
<select
|
||||
className="w-full p-3 dark:text-white dark:bg-[#343541] border border-neutral-500 rounded-lg appearance-none focus:shadow-outline text-neutral-900 cursor-pointer"
|
||||
placeholder={t("Select a model") || ''}
|
||||
className="focus:shadow-outline w-full cursor-pointer appearance-none rounded-lg border border-neutral-500 p-3 text-neutral-900 dark:bg-[#343541] dark:text-white"
|
||||
placeholder={t('Select a model') || ''}
|
||||
value={model.id}
|
||||
onChange={(e) => {
|
||||
onModelChange(models.find((model) => model.id === e.target.value) as OpenAIModel);
|
||||
onModelChange(
|
||||
models.find((model) => model.id === e.target.value) as OpenAIModel,
|
||||
);
|
||||
}}
|
||||
>
|
||||
{models.map((model) => (
|
||||
<option
|
||||
key={model.id}
|
||||
value={model.id}
|
||||
>
|
||||
<option key={model.id} value={model.id}>
|
||||
{model.name}
|
||||
</option>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user