refactor(sidebar): integrate settings modal into SidebarModals and update props

This commit is contained in:
Haileyesus
2026-02-07 16:52:52 +03:00
parent 2c5e534121
commit fdf2b09290
5 changed files with 45 additions and 23 deletions

View File

@@ -3,9 +3,15 @@ import { AlertTriangle, Trash2 } from 'lucide-react';
import type { TFunction } from 'i18next';
import { Button } from '../ui/button';
import ProjectCreationWizard from '../ProjectCreationWizard';
import Settings from '../Settings';
import type { Project } from '../../types/app';
import type { DeleteProjectConfirmation, SessionDeleteConfirmation } from './types';
type SidebarModalsProps = {
projects: Project[];
showSettings: boolean;
settingsInitialTab: string;
onCloseSettings: () => void;
showNewProject: boolean;
onCloseNewProject: () => void;
onProjectCreated: () => void;
@@ -19,6 +25,10 @@ type SidebarModalsProps = {
};
export default function SidebarModals({
projects,
showSettings,
settingsInitialTab,
onCloseSettings,
showNewProject,
onCloseNewProject,
onProjectCreated,
@@ -41,6 +51,13 @@ export default function SidebarModals({
document.body,
)}
<Settings
isOpen={showSettings}
onClose={onCloseSettings}
projects={projects as any}
initialTab={settingsInitialTab}
/>
{deleteConfirmation &&
ReactDOM.createPortal(
<div className="fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50 p-4">

View File

@@ -35,6 +35,9 @@ export type SidebarProps = {
loadingProgress: LoadingProgress | null;
onRefresh: () => Promise<void> | void;
onShowSettings: () => void;
showSettings: boolean;
settingsInitialTab: string;
onCloseSettings: () => void;
isMobile: boolean;
};