UNPKG

@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.

2 lines (1 loc) 4.55 kB
import{a as A,n as rt,e as v,t as F}from"../chunks/disclose-version.BTC8Bk4r.js";import"../chunks/legacy.DKpsC3nd.js";import{p as G,t as B,b as J,l as D,a as st,s as o,d as r,r as e,c as H,g as s,m as L}from"../chunks/runtime.NVyxXVLy.js";import{s as g}from"../chunks/render.Dr_6zaa7.js";import{e as ot,i as nt}from"../chunks/each.e-7RQQYD.js";import{s as i}from"../chunks/attributes.CqauuZ_8.js";import{a as lt,s as ct}from"../chunks/class.DCW6ehBg.js";import{i as K}from"../chunks/lifecycle.BF-zkLgr.js";import{p as m}from"../chunks/props.Btle0pBM.js";import{s as it,a as pt}from"../chunks/store.EL_7F1Fq.js";import{g as M}from"../chunks/entry.CYtqVooA.js";import{p as dt}from"../chunks/stores.DmQQ1jkb.js";import{t as gt}from"../chunks/util.8sVtkjoC.js";var ut=rt('<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path><circle cx="12" cy="12" r="3"></circle></svg>');function bt(f,c){G(c,!1);let n=m(c,"size",12,"24"),u=m(c,"strokeWidth",8,2),p=m(c,"class",8,"");n()!=="100%"&&n(n().slice(-1)==="x"?n().slice(0,n().length-1)+"em":parseInt(n())+"px"),K();var a=ut();B(()=>{i(a,"width",n()),i(a,"height",n()),i(a,"stroke-width",u()),lt(a,`feather feather-eye ${p()??""}`)}),A(f,a),J()}var xt=F('<tr><td class="py-2 px-4"><a class="text-blue-500"><span class="ml-2"> </span></a></td><td class="py-2 px-4 text-center"> </td><td class="py-2 px-4 text-center"><a class="text-blue-500"> </a></td><td class="py-2 px-4 text-center"> </td><td class="py-2 px-4 tex"> </td><td class="py-2 px-4 text-center"><a target="_blank"><!></a></td></tr>'),vt=F('<section class="container mx-auto text-sm"><h2 class="text-xl font-bold text-center text-gray-500 mb-4">Proposals</h2> <div class="flex flex-wrap justify-between mt-4 mb-2"><button class="px-4 py-2 text-blue-500 font-medium rounded-md bg-gray-100 hover:bg-gray-200 transition-colors" role="button">&lt; Previous</button> <button class="px-4 py-2 text-blue-500 font-medium rounded-md bg-gray-100 hover:bg-gray-200 transition-colors" role="button">Next &gt;</button></div> <div class="overflow-x-auto"><table class="w-full bg-white border border-gray-300"><thead><tr><th class="py-2 px-4 bg-gray-100 font-bold text-center">Transaction Hash</th><th class="py-2 px-4 bg-gray-100 font-bold text-center">Index</th><th class="py-2 px-4 bg-gray-100 font-bold text-center">Block</th><th class="py-2 px-4 bg-gray-100 font-bold text-center">Action Type</th><th class="py-2 px-4 bg-gray-100 font-bold text-center">Return Address</th><th class="py-2 px-4 bg-gray-100 font-bold text-center">Details</th></tr></thead><tbody></tbody></table></div> <div class="flex flex-wrap justify-between mt-2 mb-2"><button class="px-4 py-2 text-blue-500 font-medium rounded-md bg-gray-100 hover:bg-gray-200 transition-colors" role="button">&lt; Previous</button> <button class="px-4 py-2 text-blue-500 font-medium rounded-md bg-gray-100 hover:bg-gray-200 transition-colors" role="button">Next &gt;</button></div></section>');function At(f,c){G(c,!1);const n=it(),u=()=>pt(dt,"$page",n),p=L();let a=m(c,"data",12),b=L([]);const C=()=>{let t=parseInt(a().page)-1;t<=0&&(t=1),M(`/governance/govactions?page=${t}&count=${a().count}`)},E=()=>{let l=parseInt(a().page),t=l+1;a().govactions.length==0&&(t=l),M(`/governance/govactions?page=${t}&count=${a().count}`)};console.log(a()),a().govactions||a(a().govactions=[],!0),D(()=>u(),()=>{H(p,u().url.searchParams.get("page"))}),D(()=>(s(b),s(p)),()=>{s(b).forEach(l=>{let w=l.href.split("?").slice(1).join("?");new URLSearchParams(w).get("page")===s(p)?l.active=!0:l.active=!1}),H(b,s(b))}),st(),K();var h=vt(),y=o(r(h),2),N=r(y),O=o(N,2);e(y);var _=o(y,2),R=r(_),S=o(r(R));ot(S,5,()=>a().govactions,nt,(l,t,w)=>{var d=xt();ct(d,w%2===0?"bg-gray-50":"bg-white");var x=r(d),k=r(x),W=r(k),X=r(W,!0);B(()=>g(X,gt(s(t).tx_hash,30,"..."))),e(W),e(k),e(x);var P=o(x),Y=r(P,!0);e(P);var $=o(P),I=r($),Z=r(I,!0);e(I),e($);var j=o($),tt=r(j,!0);e(j);var z=o(j),et=r(z,!0);e(z);var q=o(z),U=r(q),at=r(U);bt(at,{size:"1.5x"}),e(U),e(q),e(d),B(()=>{i(k,"href",`/transactions/${s(t).tx_hash??""}`),g(Y,s(t).index),i(I,"href",`/blocks/${s(t).block_number??""}`),g(Z,s(t).block_number),g(tt,s(t).type),g(et,s(t).return_address),i(U,"href",`/governance/govactions/${s(t).tx_hash??""}_${s(t).index??""}`)}),A(l,d)}),e(S),e(R),e(_);var T=o(_,2),V=r(T),Q=o(V,2);e(T),e(h),v("click",N,C),v("click",O,E),v("click",V,C),v("click",Q,E),A(f,h),J()}export{At as component};