'use strict'; import { h, render, useState, useEffect, useRef, html, Router } from './bundle.js'; export const Icons = { heart: props => html``, downArrowBox: props => html` `, upArrowBox: props => html` `, settings: props => html` `, scan: props => html` `, desktop: props => html` `, alert: props => html` `, bell: props => html` `, refresh: props => html` `, bars4: props => html` `, bars3: props => html` `, logout: props => html` `, save: props => html` `, email: props => html` `, expand: props => html` `, shrink: props => html` `, ok: props => html``, fail: props => html` `, upload: props => html` `, download: props => html` `, bolt: props => html` `, home: props => html` `, link: props => html` `, shield: props => html` `, barsdown: props => html` `, arrowdown: props => html` `, arrowup: props => html` `, warn: props => html` `, info: props => html` `, exclamationTriangle: props => html` ` }; export const tipColors = { green: 'bg-green-100 text-green-900', yellow: 'bg-yellow-100 text-yellow-900', red: 'bg-red-100 text-red-900', }; export function Button({title, onclick, disabled, cls, icon, ref, colors, hovercolor, disabledcolor}) { const [spin, setSpin] = useState(false); const cb = function(ev) { const res = onclick ? onclick() : null; if (res && typeof (res.catch) === 'function') { setSpin(true); res.catch(() => false).then(() => setSpin(false)); } }; if (!colors) colors = 'bg-blue-600 hover:bg-blue-500 disabled:bg-blue-400'; return html`