diff --git a/src/components/LeftSidebar.tsx b/src/components/LeftSidebar.tsx index 83f99e5..3aea924 100644 --- a/src/components/LeftSidebar.tsx +++ b/src/components/LeftSidebar.tsx @@ -1,9 +1,8 @@ import React, { useState, useRef, useCallback, useEffect } from 'react'; -import { Upload, LogIn, LogOut, FileText, Clock, ChevronLeft, ChevronRight, History, MousePointerClick, FileUp, ClipboardPaste, Loader2 } from 'lucide-react'; +import { Upload, LogOut, FileText, Clock, ChevronLeft, ChevronRight, MousePointerClick, FileUp, ClipboardPaste, Loader2 } from 'lucide-react'; import { useAuth } from '../contexts/AuthContext'; import { useLanguage } from '../contexts/LanguageContext'; import { FileRecord } from '../types'; -import AuthModal from './AuthModal'; interface LeftSidebarProps { files: FileRecord[]; @@ -18,6 +17,8 @@ interface LeftSidebarProps { hasMore: boolean; loadingMore: boolean; onLoadMore: () => void; + historyEnabled: boolean; + onToggleHistory: () => void; } export default function LeftSidebar({ @@ -33,22 +34,16 @@ export default function LeftSidebar({ hasMore, loadingMore, onLoadMore, + historyEnabled, + onToggleHistory, }: LeftSidebarProps) { - const { user, signOut, isAuthenticated } = useAuth(); + const { user, signOut } = useAuth(); const { t } = useLanguage(); - const [showAuthModal, setShowAuthModal] = useState(false); const [isDragging, setIsDragging] = useState(false); const fileInputRef = useRef(null); const listRef = useRef(null); const displayName = user?.username?.trim() || user?.email || ''; - useEffect(() => { - if (isAuthenticated) { - setShowAuthModal(false); - } - }, [isAuthenticated]); - - // ... (rest of the logic remains the same) // Handle scroll to load more const handleScroll = useCallback(() => { if (!listRef.current || loadingMore || !hasMore) return; @@ -149,19 +144,7 @@ export default function LeftSidebar({ -
- -
- - +
); } @@ -236,9 +219,25 @@ export default function LeftSidebar({ {/* Middle Area: History */}