({
activeTab,
onTabChange,
})
| 21 | } |
| 22 | |
| 23 | const SettingsSidebar: React.FC<SettingsSidebarProps> = ({ |
| 24 | activeTab, |
| 25 | onTabChange, |
| 26 | }) => { |
| 27 | const { t } = useTranslation(); |
| 28 | const navigate = useNavigate(); |
| 29 | const { logout } = useAuth(); |
| 30 | const { showSuccess } = useNotifications(); |
| 31 | |
| 32 | const handleLogout = async () => { |
| 33 | try { |
| 34 | await logout(); |
| 35 | navigate('/'); |
| 36 | |
| 37 | // Show success notification for signout |
| 38 | showSuccess( |
| 39 | t('settings.signout.successTitle', { defaultValue: 'Signed out successfully' }), |
| 40 | t('settings.signout.successMessage', { defaultValue: "You've been securely signed out of DataKit." }), |
| 41 | { |
| 42 | icon: 'shield', |
| 43 | duration: 3000 |
| 44 | } |
| 45 | ); |
| 46 | } catch (error) { |
| 47 | console.error('Logout failed:', error); |
| 48 | } |
| 49 | }; |
| 50 | |
| 51 | const tabs = [ |
| 52 | { id: "profile", name: t('settings.tabs.profile', { defaultValue: 'Profile' }), icon: User }, |
| 53 | { id: "workspace", name: t('settings.tabs.workspace', { defaultValue: 'Workspace & Team' }), icon: Users }, |
| 54 | { id: "ai", name: t('settings.tabs.ai', { defaultValue: 'AI assistant settings' }), icon: Cpu }, |
| 55 | { id: "appearance", name: t('settings.tabs.appearance', { defaultValue: 'Appearance' }), icon: Palette }, |
| 56 | { id: "notifications", name: t('settings.tabs.notifications', { defaultValue: 'Notifications' }), icon: Bell }, |
| 57 | { id: "subscription", name: t('settings.tabs.subscription', { defaultValue: 'Subscription' }), icon: CreditCard }, |
| 58 | ]; |
| 59 | |
| 60 | return ( |
| 61 | <div className="bg-darkNav flex flex-col h-full border-r border-gray-500/20 overflow-hidden w-56"> |
| 62 | {/* Header with title - matching main sidebar style */} |
| 63 | <div className="px-5 py-4 border-b border-gray-500/20 bg-black/20 flex items-center gap-3"> |
| 64 | <button |
| 65 | onClick={() => navigate("/")} |
| 66 | className="text-white/70 hover:text-white transition-colors p-1 cursor-pointer hover:bg-white/5 rounded" |
| 67 | aria-label="Back to DataKit" |
| 68 | > |
| 69 | <ArrowLeft size={18} /> |
| 70 | </button> |
| 71 | <div> |
| 72 | <h1 className="text-white font-heading font-medium text-lg"> |
| 73 | {t('settings.header.title', { defaultValue: 'Settings' })} |
| 74 | </h1> |
| 75 | <p className="text-xs text-white/50">{t('settings.header.subtitle', { defaultValue: 'Manage your account' })}</p> |
| 76 | </div> |
| 77 | </div> |
| 78 | |
| 79 | {/* Settings Navigation */} |
| 80 | <div className="px-5 pt-2 pb-2 flex-1"> |
nothing calls this directly
no test coverage detected