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,l as u,n as W,$ as X,o as r,s as i,q as Y,g as t,v as s,w as C,x as B,y as Z,k as Q,i as ee}from"../chunks/DScGFiBY.js";import{s as d}from"../chunks/B7h8GtFa.js";import{i as te}from"../chunks/BlbL38UD.js";import{e as se}from"../chunks/BhGBB4Qh.js";import{h as re}from"../chunks/ChlQth4G.js";import{s as ae}from"../chunks/BPc-JNDc.js";import{B as N}from"../chunks/CcEFwafz.js";import{C as T,a as z}from"../chunks/Y4l2nr7b.js";import{I as oe}from"../chunks/CB0VnWqK.js";var le=u('<p class="text-muted-foreground text-center text-sm"> </p> <p class="text-muted-foreground text-center text-xs"> </p> <a href="/receipts/new"><!></a> <a href="/"><!></a>',1),ie=u('<a class="font-medium hover:underline"> </a>'),ce=u('<div class="flex flex-col gap-2"></div>'),ne=u('<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">Receipts</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="/receipts/new" class="block shrink-0"><!></a></div></div> <!></main>');function ge(A,R){U(R,!0);let v=Z("");const c=Q(()=>{var e;return((e=R.data)==null?void 0:e.receipts)??[]}),m=Q(()=>(()=>{const e=t(v).trim().toLowerCase();return e?t(c).filter(a=>a.id.toLowerCase().includes(e)):t(c)})());var h=ne();re("16kr07e",e=>{W(()=>{X.title="Receipts Stackq"})});var x=r(h),j=i(r(x),2),$=r(j),D=r($);oe(D,{type:"search",placeholder:"Search receipts…",class:"h-11 w-full sm:h-9",get value(){return t(v)},set value(e){Y(v,e,!0)}}),s($);var _=i($,2),E=r(_);s(_);var q=i(_,2),F=r(q);N(F,{class:"w-full sm:w-auto min-h-11",children:(e,a)=>{C();var n=B("New receipt");l(e,n)},$$slots:{default:!0}}),s(q),s(j),s(x);var G=i(x,2);{var H=e=>{T(e,{children:(a,n)=>{z(a,{class:"flex flex-col items-center justify-center gap-4 py-12",children:(f,I)=>{var g=le(),p=ee(g),L=r(p,!0);s(p);var o=i(p,2),w=r(o,!0);s(o);var k=i(o,2),K=r(k);N(K,{variant:"outline",children:(y,O)=>{C();var P=B("New receipt");l(y,P)},$$slots:{default:!0}}),s(k);var S=i(k,2),M=r(S);N(M,{variant:"ghost",children:(y,O)=>{C();var P=B("Back to home");l(y,P)},$$slots:{default:!0}}),s(S),b(()=>{d(L,t(c).length===0?"No receipts yet.":"No receipts match your search."),d(w,t(c).length===0?"Create a receipt to get started.":"Try a different search.")}),l(f,g)},$$slots:{default:!0}})},$$slots:{default:!0}})},J=e=>{var a=ce();se(a,21,()=>t(m),n=>n.id,(n,f)=>{T(n,{children:(I,g)=>{z(I,{class:"p-4",children:(p,L)=>{var o=ie(),w=r(o);s(o),b(()=>{ae(o,"href",`/receipts/${t(f).id??""}`),d(w,`Receipt ${t(f).id??""}`)}),l(p,o)},$$slots:{default:!0}})},$$slots:{default:!0}})}),s(a),l(e,a)};te(G,e=>{t(m).length===0?e(H):e(J,!1)})}s(h),b(()=>d(E,`${t(m).length??""}${t(m).length!==t(c).length?` of ${t(c).length}`:""} receipts`)),l(A,h),V()}export{ge as component};