diff --git a/frontend/src/layout/navigation/SideBar/PageButton.tsx b/frontend/src/layout/navigation/SideBar/PageButton.tsx deleted file mode 100644 index d11b2ba20bb6f..0000000000000 --- a/frontend/src/layout/navigation/SideBar/PageButton.tsx +++ /dev/null @@ -1,82 +0,0 @@ -import { useValues } from 'kea' -import { LemonButton, LemonButtonProps, SideAction } from 'lib/lemon-ui/LemonButton' -import { LemonTag } from 'lib/lemon-ui/LemonTag/LemonTag' -import { sceneLogic } from 'scenes/sceneLogic' -import { sceneConfigurations } from 'scenes/scenes' -import { Scene } from 'scenes/sceneTypes' - -import { SidebarChangeNoticeTooltip } from '~/layout/navigation/SideBar/SidebarChangeNotice' -import { dashboardsModel } from '~/models/dashboardsModel' - -import { breadcrumbsLogic } from '../Breadcrumbs/breadcrumbsLogic' - -export interface PageButtonProps extends Pick { - /** Used for highlighting the active scene. `identifier` of type number means dashboard ID instead of scene. */ - identifier: string | number - sideAction?: Omit & { identifier?: string } - title?: React.ReactNode - highlight?: 'alpha' | 'beta' | 'new' -} - -export function PageButton({ title, sideAction, identifier, highlight, ...buttonProps }: PageButtonProps): JSX.Element { - const { activeScene } = useValues(sceneLogic) - const { sceneBreadcrumbKeys } = useValues(breadcrumbsLogic) - const { lastDashboardId } = useValues(dashboardsModel) - - const isActiveSide: boolean = !!sideAction?.identifier && activeScene === sideAction.identifier - const isActive: boolean = - isActiveSide || - (typeof identifier === 'string' - ? activeScene === identifier || sceneBreadcrumbKeys.includes(identifier) - : activeScene === Scene.Dashboard && identifier === lastDashboardId) - - title = title || sceneConfigurations[identifier]?.name || identifier - - return ( -
  • - - {sideAction ? ( - {}} - sideAction={{ - ...sideAction, - 'data-attr': sideAction.identifier - ? `menu-item-${sideAction.identifier.toLowerCase()}` - : undefined, - }} - data-attr={`menu-item-${identifier.toString().toLowerCase()}`} - {...buttonProps} - > - {title} - - ) : ( - {}} - sideIcon={null} - {...buttonProps} - > - {title} - {highlight === 'alpha' ? ( - - Alpha - - ) : highlight === 'beta' ? ( - - Beta - - ) : highlight === 'new' ? ( - - New - - ) : null} - - )} - -
  • - ) -}