'use strict'; import { h, render, useState, useEffect, useRef, html, Router } from './bundle.js'; const Logo = props => html``; const IconHeart = props => html``; const IconDownArrowBox = props => html` `; const IconUpArrowBox = props => html` `; const IconSettings = props => html` `; const IconDesktop = props => html` `; const IconScan = props => html` `; const IconAlert = props => html` `; const IconRefresh = props => html` `; const IconBars4 = props => html` `; const IconBars3 = props => html` `; const IconLogout = props => html` `; const IconSave = props => html` `; const IconEmail = props => html` `; const IconExpand = props => html` `; const IconShrink = props => html` `; const IconOk = props => html``; const IconFailed = props => html` `; const IconUpload = props => html` `; const IconDownload = props => html` `; const IconBolt = props => html` `; const IconHome = props => html` `; const IconLink = props => html` `; const IconShield = props => html` `; const IconBarsDown = props => html` `; const IconArrowDown = props => html` `; const IconArrowUp = props => html` `; const IconExclamationTriangle = props => html` `; const tipColors = { green: 'bg-green-100 text-green-900', yellow: 'bg-yellow-100 text-yellow-900', red: 'bg-red-100 text-red-900', }; 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`