'use client'; import { useChatStore } from '../store'; import Profile from './Profile'; import Personal from './Personal'; import VoiceActor from './VoiceActor'; import Font from './Font'; import MaxToken from './MaxToken'; import Background from './Background'; import ChatModel from './ChatModel'; import Language from './Language'; import { IconButton } from '@/components/ui/button'; import React, { useState } from 'react'; import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from '@/components/ui/alert-dialog'; type SettingProps = { open: boolean; onOpenChange: (open: boolean) => void; }; export type ActiveTabType = | 'profile' | 'personal' | 'history' | 'voice_actor' | 'font' | 'max_token' | 'background' | 'model' | 'language'; const titleMap = { personal: 'Personal', history: 'History', voice_actor: 'Voice Actor', font: 'Font', max_token: 'Max Token', background: 'Background', model: 'Chat Model', language: 'Language', }; export default function SettingDialog({ open, onOpenChange }: SettingProps) { const [activeTab, setActiveTab] = useState('profile'); return ( {activeTab === 'profile' ? ( ) : ( titleMap[activeTab] )} {activeTab !== 'profile' && ( setActiveTab('profile')}> )}
{activeTab === 'profile' && } {activeTab === 'personal' && } {activeTab === 'voice_actor' && } {activeTab === 'font' && } {activeTab === 'max_token' && } {activeTab === 'background' && } {activeTab === 'model' && } {activeTab === 'language' && }
); }