Files

2 lines
3.2 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import"../chunks/Bzak7iHL.js";import{p as U,t as b,j as l,m as V,n as W,q as X,g as e,x as C,l as v,y as Y,o as s,$ as Z,s as c,v as a,w as B,k as Q,i as tt}from"../chunks/DScGFiBY.js";import{s as d}from"../chunks/B7h8GtFa.js";import{i as et}from"../chunks/BlbL38UD.js";import{e as at}from"../chunks/BhGBB4Qh.js";import{h as st}from"../chunks/ChlQth4G.js";import{s as rt}from"../chunks/BPc-JNDc.js";import{B as A}from"../chunks/CcEFwafz.js";import{C as T,a as z}from"../chunks/Y4l2nr7b.js";import{I as ot}from"../chunks/CB0VnWqK.js";var lt=v('<p class="text-muted-foreground text-center text-sm"> </p> <p class="text-muted-foreground text-center text-xs"> </p> <a href="/accounts/new"><!></a> <a href="/"><!></a>',1),ct=v('<a class="font-medium hover:underline"> </a>'),nt=v('<div class="flex flex-col gap-2"></div>'),it=v('<main class="container mx-auto flex flex-col gap-6 px-4 py-6 sm:px-6 sm:py-8"><div class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between"><div class="flex items-center gap-3 min-w-0"><a href="/" class="text-muted-foreground hover:text-foreground shrink-0 text-sm" title="Back to main">Back</a> <h1 class="text-xl font-semibold truncate sm:text-2xl">Accounts</h1></div> <div class="flex flex-col gap-3 sm:flex-row sm:flex-wrap sm:items-center sm:gap-2"><div class="w-full sm:w-64 sm:min-w-0"><!></div> <span class="text-muted-foreground text-sm shrink-0"> </span> <a href="/accounts/new" class="block shrink-0"><!></a></div></div> <!></main>');function gt(D,N){U(N,!0);let p=Y("");const n=Q(()=>{var t;return((t=N.data)==null?void 0:t.accounts)??[]}),m=Q(()=>(()=>{const t=e(p).trim().toLowerCase();return t?e(n).filter(r=>r.id.toLowerCase().includes(t)):e(n)})());var x=it();st("11yx1mx",t=>{W(()=>{Z.title="Accounts Stackq"})});var h=s(x),j=c(s(h),2),$=s(j),E=s($);ot(E,{type:"search",placeholder:"Search accounts…",class:"h-11 w-full sm:h-9",get value(){return e(p)},set value(t){X(p,t,!0)}}),a($);var _=c($,2),F=s(_);a(_);var q=c(_,2),G=s(q);A(G,{class:"w-full sm:w-auto min-h-11",children:(t,r)=>{B();var i=C("New account");l(t,i)},$$slots:{default:!0}}),a(q),a(j),a(h);var H=c(h,2);{var J=t=>{T(t,{children:(r,i)=>{z(r,{class:"flex flex-col items-center justify-center gap-4 py-12",children:(f,I)=>{var g=lt(),u=tt(g),L=s(u,!0);a(u);var o=c(u,2),w=s(o,!0);a(o);var y=c(o,2),M=s(y);A(M,{variant:"outline",children:(k,R)=>{B();var P=C("New account");l(k,P)},$$slots:{default:!0}}),a(y);var S=c(y,2),O=s(S);A(O,{variant:"ghost",children:(k,R)=>{B();var P=C("Back to home");l(k,P)},$$slots:{default:!0}}),a(S),b(()=>{d(L,e(n).length===0?"No accounts yet.":"No accounts match your search."),d(w,e(n).length===0?"Create an account to get started.":"Try a different search.")}),l(f,g)},$$slots:{default:!0}})},$$slots:{default:!0}})},K=t=>{var r=nt();at(r,21,()=>e(m),i=>i.id,(i,f)=>{T(i,{children:(I,g)=>{z(I,{class:"p-4",children:(u,L)=>{var o=ct(),w=s(o);a(o),b(()=>{rt(o,"href",`/accounts/${e(f).id??""}`),d(w,`Account ${e(f).id??""}`)}),l(u,o)},$$slots:{default:!0}})},$$slots:{default:!0}})}),a(r),l(t,r)};et(H,t=>{e(m).length===0?t(J):t(K,!1)})}a(x),b(()=>d(F,`${e(m).length??""}${e(m).length!==e(n).length?` of ${e(n).length}`:""} accounts`)),l(D,x),V()}export{gt as component};