mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-22 22:16:13 -04:00
Convert Menu components to TypeScript
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
import classNames from 'classnames';
|
||||
import React from 'react';
|
||||
import Icon, { IconName } from 'Components/Icon';
|
||||
import MenuButton, { MenuButtonProps } from 'Components/Menu/MenuButton';
|
||||
import { icons } from 'Helpers/Props';
|
||||
import styles from './ToolbarMenuButton.css';
|
||||
|
||||
export interface ToolbarMenuButtonProps
|
||||
extends Omit<MenuButtonProps, 'children'> {
|
||||
className?: string;
|
||||
iconName: IconName;
|
||||
showIndicator?: boolean;
|
||||
text?: string;
|
||||
}
|
||||
|
||||
function ToolbarMenuButton({
|
||||
iconName,
|
||||
showIndicator = false,
|
||||
text,
|
||||
...otherProps
|
||||
}: ToolbarMenuButtonProps) {
|
||||
return (
|
||||
<MenuButton className={styles.menuButton} {...otherProps}>
|
||||
<div>
|
||||
<Icon name={iconName} size={21} />
|
||||
|
||||
{showIndicator ? (
|
||||
<span
|
||||
className={classNames(styles.indicatorContainer, 'fa-layers fa-fw')}
|
||||
>
|
||||
<Icon name={icons.CIRCLE} size={9} />
|
||||
</span>
|
||||
) : null}
|
||||
|
||||
<div className={styles.labelContainer}>
|
||||
<div className={styles.label}>{text}</div>
|
||||
</div>
|
||||
</div>
|
||||
</MenuButton>
|
||||
);
|
||||
}
|
||||
|
||||
export default ToolbarMenuButton;
|
||||
Reference in New Issue
Block a user