Spaces:
Build error
Build error
File size: 845 Bytes
d61b9c7 |
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 30 31 32 33 34 35 36 37 38 |
import React from "react";
import cx from "../utils/cx";
import styles from "../App.module.css";
interface LabelButtonProps {
labelIndex: number;
inputIndex: number;
modelIndex: number;
active: boolean;
onTargetClick: (
labelIndex: number,
inputIndex: number,
modelIndex: number
) => void;
}
function LabelButton(props: React.PropsWithChildren<LabelButtonProps>) {
const onClick = (e: React.MouseEvent<HTMLButtonElement>) => {
e.preventDefault();
props.onTargetClick(props.labelIndex, props.inputIndex, props.modelIndex);
};
return (
<button
onClick={onClick}
className={cx({
[styles.btn]: true,
[styles["btn--solid"]]: props.active,
[styles["btn--outline"]]: !props.active,
})}
>
{props.children}
</button>
);
}
export default LabelButton;
|