2022-05-06 10:25:10 +01:00
|
|
|
import { FunctionComponent, h } from "preact";
|
2022-04-08 16:16:12 +01:00
|
|
|
import style from "./Button.module.scss";
|
|
|
|
|
2023-01-13 14:44:07 +01:00
|
|
|
interface ButtonProps extends h.JSX.HTMLAttributes<HTMLButtonElement> {
|
2024-11-18 17:08:52 +00:00
|
|
|
intent?: "remove";
|
2023-01-13 14:44:07 +01:00
|
|
|
}
|
|
|
|
|
2024-11-18 17:08:52 +00:00
|
|
|
export const Button: FunctionComponent<ButtonProps> = (props) => {
|
2022-04-08 16:16:12 +01:00
|
|
|
let className = style.button;
|
|
|
|
if (props.intent === "remove") {
|
2023-01-13 14:44:07 +01:00
|
|
|
className += ` ${style.remove}`;
|
2022-04-08 16:16:12 +01:00
|
|
|
}
|
2022-04-30 06:08:13 +01:00
|
|
|
return <button type="button" className={className} {...props} />;
|
2022-04-08 16:16:12 +01:00
|
|
|
}
|