File size: 643 Bytes
31abd2c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
import * as React from "react";
import styles from "./button.module.scss";
export function IconButton(props: {
onClick?: () => void;
icon: JSX.Element;
text?: string;
bordered?: boolean;
className?: string;
title?: string;
}) {
return (
<div
className={
styles["icon-button"] +
` ${props.bordered && styles.border} ${props.className ?? ""}`
}
onClick={props.onClick}
title={props.title}
>
<div className={styles["icon-button-icon"]}>{props.icon}</div>
{props.text && (
<div className={styles["icon-button-text"]}>{props.text}</div>
)}
</div>
);
}
|