@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.81 kB
JavaScript
import{e as c,a as H,t as z}from"../chunks/disclose-version.BTC8Bk4r.js";import"../chunks/legacy.DKpsC3nd.js";import{p as tt,l as J,a as et,f as at,b as rt,s as o,d as r,g as e,m as b,c as i,r as a,t as st}from"../chunks/runtime.NVyxXVLy.js";import{s as d}from"../chunks/render.Dr_6zaa7.js";import{e as ot,i as lt}from"../chunks/each.e-7RQQYD.js";import{s as L}from"../chunks/attributes.CqauuZ_8.js";import{s as nt}from"../chunks/class.DCW6ehBg.js";import{i as ct}from"../chunks/lifecycle.BF-zkLgr.js";import{p as it}from"../chunks/props.Btle0pBM.js";import{s as pt,a as gt}from"../chunks/store.EL_7F1Fq.js";import{g as O}from"../chunks/entry.CYtqVooA.js";import{p as ut}from"../chunks/stores.DmQQ1jkb.js";import{D as bt}from"../chunks/DRepDetails.BflGaRUd.js";var dt=z('<tr><td class="py-2 px-4"><a href="#" class="text-blue-500"><span class="ml-2"> </span></a></td><td class="py-2 px-4"> </td><td class="py-2 px-4"><a class="text-blue-500"> </a></td><td class="py-2 px-4"><a class="text-blue-500"> </a></td></tr>'),ft=z('<section class="container mx-auto text-sm"><h2 class="text-xl font-bold text-center text-gray-500 mb-4">DRep Registrations</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">< 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 ></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">DRep Id</th><th class="py-2 px-4 bg-gray-100 font-bold text-center">Type</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">Txn Hash</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">< 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 ></button></div></section> <!>',1);function jt(A,k){tt(k,!1);const C=pt(),D=()=>gt(ut,"$page",C),f=b();let l=it(k,"data",12),p=b([]);const R=()=>{let t=parseInt(l().page)-1;t<=0&&(t=1),O(`/governance/drep-registrations?page=${t}&count=${l().count}`)},U=()=>{let s=parseInt(l().page),t=s+1;l().registrations.length==0&&(t=s),O(`/governance/drep-registrations?page=${t}&count=${l().count}`)};l().registrations||l(l().registrations=[],!0);let g=b(!1),j=b({});const F=s=>{i(j,s),i(g,!e(g)),console.log(JSON.stringify(s))};function G(){i(g,!1)}J(()=>D(),()=>{i(f,D().url.searchParams.get("page"))}),J(()=>(e(p),e(f)),()=>{e(p).forEach(s=>{let h=s.href.split("?").slice(1).join("?");new URLSearchParams(h).get("page")===e(f)?s.active=!0:s.active=!1}),i(p,e(p))}),et(),ct();var I=ft(),m=at(I),v=o(r(m),2),N=r(v),K=o(N,2);a(v);var x=o(v,2),S=r(x),T=o(r(S));ot(T,5,()=>l().registrations,lt,(s,t,h)=>{var n=dt();nt(n,h%2===0?"bg-gray-50":"bg-white");var u=r(n),B=r(u),y=r(B),W=r(y,!0);a(y),a(B),a(u);var _=o(u),X=r(_,!0);a(_);var w=o(_),P=r(w),Y=r(P,!0);a(P),a(w);var E=o(w),$=r(E),Z=r($,!0);a($),a(E),a(n),st(()=>{d(W,e(t).drep_id),d(X,e(t).cred_type),L(P,"href",`/blocks/${e(t).block_number??""}`),d(Y,e(t).block_number),L($,"href",`/transactions/${e(t).tx_hash??""}`),d(Z,e(t).tx_hash)}),c("click",y,()=>{F(e(t))}),H(s,n)}),a(T),a(S),a(x);var V=o(x,2),q=r(V),M=o(q,2);a(V),a(m);var Q=o(m,2);bt(Q,{get drep(){return e(j)},get show(){return e(g)},$$events:{closeDetails:G}}),c("click",N,R),c("click",K,U),c("click",q,R),c("click",M,U),H(A,I),rt()}export{jt as component};