/* eslint-disable @typescript-eslint/no-explicit-any */ import React from 'react' import { Input, Textarea } from '@janhq/uikit' import { atom, useAtomValue } from 'jotai' import { twMerge } from 'tailwind-merge' import LogoMark from '@/containers/Brand/Logo/Mark' import CardSidebar from '@/containers/CardSidebar' import DropdownListSidebar from '@/containers/DropdownListSidebar' import { useCreateNewThread } from '@/hooks/useCreateNewThread' import { getConfigurationsData } from '@/utils/componentSettings' import { toRuntimeParams, toSettingParams } from '@/utils/modelParam' import EngineSetting from '../EngineSetting' import ModelSetting from '../ModelSetting' import settingComponentBuilder from '../ModelSetting/settingComponentBuilder' import { activeThreadAtom, getActiveThreadModelParamsAtom, } from '@/helpers/atoms/Thread.atom' export const showRightSideBarAtom = atom(true) const Sidebar: React.FC = () => { const showing = useAtomValue(showRightSideBarAtom) const activeThread = useAtomValue(activeThreadAtom) const activeModelParams = useAtomValue(getActiveThreadModelParamsAtom) const { updateThreadMetadata } = useCreateNewThread() const modelEngineParams = toSettingParams(activeModelParams) const modelRuntimeParams = toRuntimeParams(activeModelParams) const componentDataEngineSetting = getConfigurationsData(modelEngineParams) const componentDataRuntimeSetting = getConfigurationsData(modelRuntimeParams) return (
{ if (activeThread) updateThreadMetadata({ ...activeThread, title: e.target.value || '', }) }} />
{activeThread?.id || '-'}
{activeThread?.assistants[0].assistant_name ?? '-'}