import { TeamDropdown } from './TeamDropdown/TeamDropdown'; import { useTeamId } from '../hooks/use-team-id'; import ChatIcon from '../icons/chat.svg'; import type { ReactNode } from 'react'; import { useState } from 'react'; import { useStore } from '@nanostores/react'; import { $currentTeam } from '../stores/team'; import { SubmitFeedbackPopup } from './Feedback/SubmitFeedbackPopup'; import { ChevronDownIcon } from './ReactIcons/ChevronDownIcon.tsx'; import { GroupIcon } from './ReactIcons/GroupIcon.tsx'; import { TeamProgressIcon } from './ReactIcons/TeamProgressIcon.tsx'; import { BarChart2, MapIcon, MessageCircle } from 'lucide-react'; import { CogIcon } from './ReactIcons/CogIcon.tsx'; type TeamSidebarProps = { activePageId: string; children: ReactNode; }; export function TeamSidebar({ activePageId, children }: TeamSidebarProps) { const [menuShown, setMenuShown] = useState(false); const currentTeam = useStore($currentTeam); const [showFeedbackPopup, setShowFeedbackPopup] = useState(false); const { teamId } = useTeamId(); const sidebarLinks = [ { title: 'Activity', href: `/team/activity?t=${teamId}`, id: 'activity', icon: BarChart2, }, { title: 'Progress', href: `/team/progress?t=${teamId}`, id: 'progress', icon: TeamProgressIcon, }, { title: 'Roadmaps', href: `/team/roadmaps?t=${teamId}`, id: 'roadmaps', icon: MapIcon, hasWarning: currentTeam?.roadmaps?.length === 0, }, { title: 'Members', href: `/team/members?t=${teamId}`, id: 'members', icon: GroupIcon, }, { title: 'Settings', href: `/team/settings?t=${teamId}`, id: 'settings', icon: CogIcon, }, ]; return ( <>
{menuShown && ( )}
{showFeedbackPopup && ( { setShowFeedbackPopup(false); }} /> )}
{children}
); }