@bloxbean/yaci-viewer
Version:
A Cardano blockchain data viewer for developers. It works with the Yaci-Store backend, supporting both a local devnet and public networks.
35 lines (32 loc) • 1.15 kB
JavaScript
import { $ as fallback, a3 as spread_attributes, X as escape_html, a1 as bind_props } from './index-vBtQgGkr.js';
function JsonContent($$payload, $$props) {
let textareaprops = {
id: "message",
name: "message",
label: "Your message",
rows: 30,
cols: 100,
placeholder: "Leave a comment..."
};
let text = fallback($$props["text"], () => ({}), true);
let rows = fallback($$props["rows"], 30);
let cols = fallback($$props["cols"], 100);
function toPrettyJson(obj) {
if (!obj) return "{}";
return JSON.stringify(obj, null, 2);
}
textareaprops = { ...textareaprops, rows, cols };
$$payload.out += `<div class="p-4 w-full w"><div class="flex flex-col mt-4"><div class="md:flex-grow"><textarea${spread_attributes({
...textareaprops,
class: "w-full h-max textarea-info text-sm md:text-base",
disabled: true
})}>`;
const $$body = escape_html(toPrettyJson(text));
if ($$body) {
$$payload.out += `${$$body}`;
}
$$payload.out += `</textarea></div></div></div>`;
bind_props($$props, { text, rows, cols });
}
export { JsonContent as J };
//# sourceMappingURL=JsonContent-DjhJhAEL.js.map