import { CheckCircleOutlineRounded } from "@mui/icons-material"; import { alpha, ListItem, ListItemButton, ListItemIcon, ListItemText, SxProps, Theme, } from "@mui/material"; import { ApiType } from "../services/types"; interface Props { proxy: ApiType.ProxyItem; selected: boolean; sx?: SxProps; onClick?: (name: string) => void; } const ProxyItem = (props: Props) => { const { proxy, selected, sx, onClick } = props; return ( onClick?.(proxy.name)} sx={[ { borderRadius: 1, }, ({ palette: { mode, primary } }) => { const bgcolor = mode === "light" ? alpha(primary.main, 0.15) : alpha(primary.main, 0.35); const color = mode === "light" ? primary.main : primary.light; return { "&.Mui-selected": { bgcolor }, "&.Mui-selected .MuiListItemText-secondary": { color }, }; }, ]} > {selected && } ); }; export default ProxyItem;