import { motion } from 'framer-motion'; import { useState } from 'react'; import { classNames } from '~/utils/classNames'; import { tabConfigurationStore, updateTabConfiguration, resetTabConfiguration } from '~/lib/stores/settings'; import { useStore } from '@nanostores/react'; import { TAB_LABELS, type TabType, type TabVisibilityConfig } from '~/components/settings/settings.types'; import { toast } from 'react-toastify'; // Define icons for each tab type const TAB_ICONS: Record = { profile: 'i-ph:user-circle-fill', settings: 'i-ph:gear-six-fill', notifications: 'i-ph:bell-fill', features: 'i-ph:sparkle-fill', data: 'i-ph:database-fill', 'cloud-providers': 'i-ph:cloud-fill', 'local-providers': 'i-ph:desktop-fill', connection: 'i-ph:plug-fill', debug: 'i-ph:bug-fill', 'event-logs': 'i-ph:list-bullets-fill', update: 'i-ph:arrow-clockwise-fill', 'task-manager': 'i-ph:gauge-fill', }; interface TabGroupProps { title: string; description?: string; tabs: TabVisibilityConfig[]; onVisibilityChange: (tabId: TabType, enabled: boolean) => void; targetWindow: 'user' | 'developer'; standardTabs: TabType[]; } const TabGroup = ({ title, description, tabs, onVisibilityChange, targetWindow }: TabGroupProps) => { // Split tabs into visible and hidden const visibleTabs = tabs.filter((tab) => tab.visible).sort((a, b) => (a.order || 0) - (b.order || 0)); const hiddenTabs = tabs.filter((tab) => !tab.visible).sort((a, b) => (a.order || 0) - (b.order || 0)); return (

{title}

{description &&

{description}

}
{visibleTabs.map((tab) => (
{TAB_LABELS[tab.id]} {tab.id === 'profile' && targetWindow === 'user' && ( Standard )}
{targetWindow === 'user' ? (