@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) • 3.6 kB
JavaScript
import{e as p,a as V,t as K}from"../chunks/disclose-version.BTC8Bk4r.js";import"../chunks/legacy.DKpsC3nd.js";import{p as O,l as q,a as Q,b as W,s as l,d as a,r as e,t as _,c as A,g as r,m as B}from"../chunks/runtime.NVyxXVLy.js";import{s as g}from"../chunks/render.Dr_6zaa7.js";import{e as X,i as Y}from"../chunks/each.e-7RQQYD.js";import{s as E}from"../chunks/attributes.CqauuZ_8.js";import{s as Z}from"../chunks/class.DCW6ehBg.js";import{i as tt}from"../chunks/lifecycle.BF-zkLgr.js";import{p as et}from"../chunks/props.Btle0pBM.js";import{s as at,a as rt}from"../chunks/store.EL_7F1Fq.js";import{g as H}from"../chunks/entry.CYtqVooA.js";import{p as st}from"../chunks/stores.DmQQ1jkb.js";import{g as ot,t as lt}from"../chunks/util.8sVtkjoC.js";var ct=K('<tr><td class="py-2 px-4"> </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"><a class="text-blue-500"><span class="ml-2"> </span></a></td></tr>'),it=K('<section class="container mx-auto text-sm"><h2 class="text-xl font-bold text-center text-gray-500 mb-4">Stake Key De-registrations</h2> <div class="flex flex-wrap justify-between mt-4 mb-2"><a href="#" class="px-4 py-2 text-blue-500 font-medium rounded-md bg-gray-100 hover:bg-gray-200 transition-colors" role="button">< Previous</a> <a href="#" class="px-4 py-2 text-blue-500 font-medium rounded-md bg-gray-100 hover:bg-gray-200 transition-colors" role="button">Next ></a></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">Address</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">Time</th><th class="py-2 px-4 bg-gray-100 font-bold text-center">Transaction Hash</th></tr></thead><tbody></tbody></table></div> <div class="flex flex-wrap justify-between mb-2"><a href="#" class="px-4 py-2 text-blue-500 font-medium rounded-md bg-gray-100 hover:bg-gray-200 transition-colors" role="button">< Previous</a> <a href="#" class="px-4 py-2 text-blue-500 font-medium rounded-md bg-gray-100 hover:bg-gray-200 transition-colors" role="button">Next ></a></div></section>');function kt(L,k){O(k,!1);const R=at(),P=()=>rt(st,"$page",R),d=B();let s=et(k,"data",12),i=B([]);const w=()=>{let t=parseInt(s().page)-1;t<=0&&(t=1),H(`/certificates/stakekey-deregistrations?page=${t}&count=${s().count}`)},$=()=>{let o=parseInt(s().page),t=o+1;s().deregistrations.length==0&&(t=o),H(`/certificates/stakekey-deregistrations?page=${t}&count=${s().count}`)};console.log(s()),s().deregistrations||s(s().deregistrations=[],!0),q(()=>P(),()=>{A(d,P().url.searchParams.get("page"))}),q(()=>(r(i),r(d)),()=>{r(i).forEach(o=>{let u=o.href.split("?").slice(1).join("?");new URLSearchParams(u).get("page")===r(d)?o.active=!0:o.active=!1}),A(i,r(i))}),Q(),tt();var m=it(),f=l(a(m),2),U=a(f),z=l(U,2);e(f);var b=l(f,2),j=a(b),S=l(a(j));X(S,5,()=>s().deregistrations,Y,(o,t,u)=>{var c=ct();Z(c,u%2===0?"bg-gray-50":"bg-white");var n=a(c),F=a(n,!0);e(n);var x=l(n),v=a(x),G=a(v,!0);e(v),e(x);var h=l(x),J=a(h,!0);_(()=>g(J,ot(r(t).block_time))),e(h);var N=l(h),y=a(N),T=a(y),M=a(T,!0);_(()=>g(M,lt(r(t).tx_hash,30,"..."))),e(T),e(y),e(N),e(c),_(()=>{g(F,r(t).address),E(v,"href",`/blocks/${r(t).block_number??""}`),g(G,r(t).block_number),E(y,"href",`/transactions/${r(t).tx_hash??""}`)}),V(o,c)}),e(S),e(j),e(b);var D=l(b,2),I=a(D),C=l(I,2);e(D),e(m),p("click",U,w),p("click",z,$),p("click",I,w),p("click",C,$),V(L,m),W()}export{kt as component};