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