18 lines
408 B
TypeScript
18 lines
408 B
TypeScript
import * as React from "react";
|
|
|
|
interface Props {
|
|
onClick: Function;
|
|
disabled: boolean;
|
|
children?: React.ReactNode;
|
|
}
|
|
|
|
export function LockableButton({ onClick, disabled, children }: Props) {
|
|
const className = disabled ? "gray" : "yellow";
|
|
return <button
|
|
className={"fb-button " + className}
|
|
disabled={disabled}
|
|
onClick={() => disabled ? "" : onClick()}>
|
|
{children}
|
|
</button>;
|
|
}
|