MCPcopy Create free account
hub / github.com/MegEngine/MegFlow / Button

Function Button

flow-debugger/debugger-ui/src/component/button/Button.js:4–31  ·  view source on GitHub ↗
({ red, bold, icon, rightIcon, children, ...props })

Source from the content-addressed store, hash-verified

2import styles from "./Button.module.css";
3
4export const Button = ({ red, bold, icon, rightIcon, children, ...props }) => {
5 const c = [styles.container];
6
7 if (bold) {
8 c.push(styles.bold);
9 }
10 if (icon) {
11 c.push(styles.hasLeftIcon);
12 }
13 if (rightIcon) {
14 c.push(styles.hasRightIcon);
15 }
16 if (red) {
17 c.push(styles.red);
18 }
19
20 return (
21 <button className={styles.button} {...props}>
22 <div className={c.join(" ")}>
23 {icon && <div className={styles.leftIcon}>{icon}</div>}
24 {children}
25 {rightIcon && (
26 <div className={styles.rightIcon}>{rightIcon}</div>
27 )}
28 </div>
29 </button>
30 );
31};

Callers

nothing calls this directly

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected