import React, { memo } from "react"; import Badge from "@mui/material/Badge"; import ListItem from "@mui/material/ListItem"; import ListItemIcon from "@mui/material/ListItemIcon"; import ListItemText from "@mui/material/ListItemText"; import Tooltip from "@mui/material/Tooltip"; import Typography from "@mui/material/Typography"; import type { Page } from "../../ui/Router"; export interface ICreateProps { key_: Page; icon: React.ReactElement["type"]; count?: number; active?: boolean; alternateKeys?: Page[]; } export interface SidebarItemProps extends ICreateProps { clickFn: () => void; flash: boolean; classes: Record<"listitem" | "active", string>; sidebarOpen: boolean; } export const SidebarItem = memo(function SidebarItem(props: SidebarItemProps): React.ReactElement { const color = props.flash ? "error" : props.active ? "primary" : "secondary"; return ( 0 ? props.count : undefined} color="error"> {props.key_} ); });