mirror of
https://github.com/matrix-org/matrix-hookshot.git
synced 2025-03-10 21:19:13 +00:00

* Button: Extend HTMLButton prop types * Use className prop instad of styles * Move style prop into scss file
14 lines
443 B
TypeScript
14 lines
443 B
TypeScript
import { FunctionComponent, h } from "preact";
|
|
import style from "./Button.module.scss";
|
|
|
|
interface ButtonProps extends h.JSX.HTMLAttributes<HTMLButtonElement> {
|
|
intent?: string;
|
|
}
|
|
|
|
export const Button: FunctionComponent = (props: ButtonProps) => {
|
|
let className = style.button;
|
|
if (props.intent === "remove") {
|
|
className += ` ${style.remove}`;
|
|
}
|
|
return <button type="button" className={className} {...props} />;
|
|
}
|