1 import { map } from 'lodash';
3 interface CoreAttributes {
8 export function ButtonWithBlock(attrs: CoreAttributes & Record<string, any>, value: string, blockTime: number): string {
13 attrs.class.push('disabled');
14 attrs['data-block'] = blockTime;
15 attrs['disabled'] = 'disabled';
17 return Button(attrs, value);
20 export function Button(attrs: CoreAttributes & Record<string, any>, value: string): string {
21 const attributes: string[] = [];
23 map(attrs, function(value, key) {
26 attributes.push(`${key}="${value.join(' ')}"`);
29 attributes.push(`${key}="${value}"`);
34 return `<button ${attributes.join(" ")}>${value}</button>`;