AdvisorsSidebarMenu.tsx38 lines · main
| 1 | import { Badge, Button } from 'ui' |
| 2 | |
| 3 | import { FeaturePreviewSidebarPanel } from '../../ui/FeaturePreviewSidebarPanel' |
| 4 | import { useGenerateAdvisorsMenu } from './AdvisorsMenu.utils' |
| 5 | import { SIDEBAR_KEYS } from '@/components/layouts/ProjectLayout/LayoutSidebar/LayoutSidebarProvider' |
| 6 | import { ProductMenu } from '@/components/ui/ProductMenu' |
| 7 | import { useSidebarManagerSnapshot } from '@/state/sidebar-manager-state' |
| 8 | |
| 9 | interface AdvisorsSidebarMenuProps { |
| 10 | page?: string |
| 11 | } |
| 12 | |
| 13 | export function AdvisorsSidebarMenu({ page }: AdvisorsSidebarMenuProps) { |
| 14 | const menu = useGenerateAdvisorsMenu() |
| 15 | const { toggleSidebar } = useSidebarManagerSnapshot() |
| 16 | |
| 17 | const handleOpenAdvisor = () => { |
| 18 | toggleSidebar(SIDEBAR_KEYS.ADVISOR_PANEL) |
| 19 | } |
| 20 | |
| 21 | return ( |
| 22 | <div className="pb-12 relative"> |
| 23 | <FeaturePreviewSidebarPanel |
| 24 | className="mx-4 mt-4" |
| 25 | title="Moving to the toolbar" |
| 26 | description="Advisors are now available in the top toolbar for quicker access across the dashboard." |
| 27 | illustration={<Badge variant="success">New</Badge>} |
| 28 | actions={ |
| 29 | <Button size="tiny" type="default" onClick={handleOpenAdvisor}> |
| 30 | Try it now |
| 31 | </Button> |
| 32 | } |
| 33 | /> |
| 34 | |
| 35 | <ProductMenu page={page} menu={menu} /> |
| 36 | </div> |
| 37 | ) |
| 38 | } |