@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.46 kB
JavaScript
import{e as p,a as S,t as H}from"../chunks/disclose-version.BTC8Bk4r.js";import"../chunks/legacy.DKpsC3nd.js";import{p as M,l as T,a as O,b as Q,s as n,d as a,r as e,t as W,c as V,g as r,m as q}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 B}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 E}from"../chunks/entry.CYtqVooA.js";import{p as st}from"../chunks/stores.DmQQ1jkb.js";var ot=H('<tr><td class="py-2 px-4"><span class="ml-2"> </span></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>'),nt=H('<section class="container mx-auto text-sm"><h2 class="text-xl font-bold text-center text-gray-500 mb-4">DRep De-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>');function ht(L,_){M(_,!1);const z=at(),P=()=>rt(st,"$page",z),b=q();let s=et(_,"data",12),i=q([]);const w=()=>{let t=parseInt(s().page)-1;t<=0&&(t=1),E(`/governance/drep-deregistrations?page=${t}&count=${s().count}`)},k=()=>{let o=parseInt(s().page),t=o+1;s().deregistrations.length==0&&(t=o),E(`/governance/drep-deregistrations?page=${t}&count=${s().count}`)};s().deregistrations||s(s().deregistrations=[],!0),T(()=>P(),()=>{V(b,P().url.searchParams.get("page"))}),T(()=>(r(i),r(b)),()=>{r(i).forEach(o=>{let f=o.href.split("?").slice(1).join("?");new URLSearchParams(f).get("page")===r(b)?o.active=!0:o.active=!1}),V(i,r(i))}),O(),tt();var d=nt(),u=n(a(d),2),$=a(u),A=n($,2);e(u);var m=n(u,2),U=a(m),j=n(a(U));X(j,5,()=>s().deregistrations,Y,(o,t,f)=>{var l=ot();Z(l,f%2===0?"bg-gray-50":"bg-white");var c=a(l),R=a(c),F=a(R,!0);e(R),e(c);var v=n(c),G=a(v,!0);e(v);var x=n(v),h=a(x),J=a(h,!0);e(h),e(x);var N=n(x),y=a(N),K=a(y,!0);e(y),e(N),e(l),W(()=>{g(F,r(t).drep_id),g(G,r(t).cred_type),B(h,"href",`/blocks/${r(t).block_number??""}`),g(J,r(t).block_number),B(y,"href",`/transactions/${r(t).tx_hash??""}`),g(K,r(t).tx_hash)}),S(o,l)}),e(j),e(U),e(m);var D=n(m,2),I=a(D),C=n(I,2);e(D),e(d),p("click",$,w),p("click",A,k),p("click",I,w),p("click",C,k),S(L,d),Q()}export{ht as component};