import React from 'react'; import { Outlet, useSearchParams } from 'react-router-dom'; import { NavItem } from '../components/NavItem'; import { UserOutlined } from '@ant-design/icons'; import { Button, Dropdown } from 'antd'; import { useUserStore } from '../store/user'; export const Layout: React.FC = React.memo(() => { const [params] = useSearchParams(); const workspaces = useUserStore((state) => { const userInfo = state.info; if (userInfo) { return userInfo.workspaces.map((w) => ({ id: w.workspace.id, name: w.workspace.name, role: w.role, current: userInfo.currentWorkspace.id === w.workspace.id, })); } return []; }); const showHeader = !params.has('hideHeader'); return (