Skip to content

Commit

Permalink
menu fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
carkom committed Jan 12, 2024
1 parent ce4a0e4 commit 3456b7c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/desktop-client/src/components/common/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,21 @@ type MenuItem = {
isOn?: boolean;
};

type MenuProps = {
type MenuProps<T extends MenuItem = MenuItem> = {
header?: ReactNode;
footer?: ReactNode;
items: Array<MenuItem | typeof Menu.line>;
onMenuSelect: (itemName: MenuItem['name']) => void;
items: Array<T | typeof Menu.line>;
onMenuSelect: (itemName: T['name']) => void;
style?: CSSProperties;
};

export function Menu({
export function Menu<T extends MenuItem>({
header,
footer,
items: allItems,
onMenuSelect,
style,
}: MenuProps) {
}: MenuProps<T>) {
const elRef = useRef(null);
const items = allItems.filter(x => x);
const [hoveredIndex, setHoveredIndex] = useState(null);
Expand Down

0 comments on commit 3456b7c

Please sign in to comment.