MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / button

Function button

libatomic/src/review/viewer.js:48–53  ·  view source on GitHub ↗
(text, action, className = '')

Source from the content-addressed store, hash-verified

46 return node;
47 };
48 const button = (text, action, className = '') => {
49 const node = el('button', className, text);
50 node.type = 'button';
51 node.addEventListener('click', action);
52 return node;
53 };
54 const title = text => String(text || '').replaceAll('_', ' ').replace(/^./, c => c.toUpperCase());
55 const shown = value => value === null || value === undefined ? 'unavailable' : String(value);
56 const badge = (text, value = text) => el('span', 'badge ' + String(value).toLowerCase().replace(/[^a-z]/g, ''), text);

Callers 6

cardCalloutFunction · 0.85
sourceViewerFunction · 0.85
renderNavigationFunction · 0.85
renderSlopFunction · 0.85
renderCriteriaFunction · 0.85
renderSummaryFunction · 0.85

Calls 1

elFunction · 0.85

Tested by

no test coverage detected