PageSourceSearch

https://app.notesense.ai/build/assets/usage-D5lJSGsQ.js

js notesense.ai collected 2026-10-05 14:07:56 UTC 6,497 bytes, 1 lines download raw bytes

1import{r as p,j as e,H as y}from"./app-CsRsKyyS.js";import{A as j,H as f}from"./app-layout-Cc27bdr-.js";/* empty css            */import"./index-BYlKxr2x.js";import"./loader-circle-C4e2AS6S.js";import"./utils-BQHNewu7.js";import"./index-D2zdmtQC.js";import"./checkbox-BudEGG9g.js";import"./x-BCZRzDgM.js";const h="usage_hourly_rate",w=[{title:"Usage",href:"/usage"}];function N(a){const s=Math.floor(a/3600),i=Math.floor(a%3600/60),x=a%60,r=[];return s&&r.push(`${s}h`),i&&r.push(`${i}m`),r.push(`${x}s`),r.join(" ")}const v=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"});function m(a,s){return v.format(a/3600*s)}function l({label:a,value:s}){return e.jsxs("div",{className:"rounded-lg border bg-white p-4",children:[e.jsx("div",{className:"text-xs font-medium uppercase tracking-wider text-gray-500",children:a}),e.jsx("div",{className:"mt-1 text-2xl font-semibold text-gray-900",children:s})]})}function $({accounts:a,organisations:s,window_days:i,since:x}){const r=s.reduce((t,d)=>t+d.appointment_count,0),o=s.reduce((t,d)=>t+d.total_seconds,0),g=new Date(x).toLocaleDateString(),[n,u]=p.useState(()=>typeof window>"u"?"":window.localStorage.getItem(h)??"");p.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(h,n)},[n]);const c=Math.max(0,parseFloat(n)||0);return e.jsxs(j,{breadcrumbs:w,children:[e.jsx(y,{title:"Usage"}),e.jsx("div",{className:"flex h-full flex-1 flex-col gap-4 overflow-x-auto rounded-xl p-4",children:e.jsxs("div",{className:"container mx-auto max-w-7xl p-4 py-6",children:[e.jsx(f,{title:"Usage",description:`Recordings over the last ${i} days (since ${g}).`}),e.jsx("div",{className:"mt-6 flex flex-wrap items-end gap-4",children:e.jsxs("div",{children:[e.jsx("label",{htmlFor:"hourly-rate",className:"text-xs font-medium uppercase tracking-wider text-gray-500",children:"Hourly rate"}),e.jsxs("div",{className:"mt-1 flex items-center rounded-lg border bg-white px-3 py-2",children:[e.jsx("span",{className:"text-gray-500",children:"$"}),e.jsx("input",{id:"hourly-rate",type:"number",min:"0",step:"0.01",inputMode:"decimal",value:n,onChange:t=>u(t.target.value),placeholder:"0.00",className:"w-28 border-0 bg-transparent px-1 text-gray-900 focus:outline-none focus:ring-0"}),e.jsx("span",{className:"text-sm text-gray-500",children:"/ hour"})]})]})}),e.jsxs("div",{className:"mt-4 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(l,{label:"Organisations",value:s.length}),e.jsx(l,{label:"Appointments recorded",value:r}),e.jsx(l,{label:"Total recording time",value:N(o)}),e.jsx(l,{label:"Estimated amount",value:m(o,c)})]}),e.jsxs("div",{className:"mt-10",children:[e.jsx("h2",{className:"mb-3 text-lg font-semibold text-gray-900",children:"By organisation"}),e.jsx("div",{className:"overflow-x-auto rounded-lg border",children:e.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[e.jsx("thead",{className:"bg-gray-50",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500",children:"Organisation"}),e.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium uppercase tracking-wider text-gray-500",children:"Users"}),e.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium uppercase tracking-wider text-gray-500",children:"Appointments"}),e.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium uppercase tracking-wider text-gray-500",children:"Total time"}),e.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium uppercase tracking-wider text-gray-500",children:"Amount"})]})}),e.jsxs("tbody",{className:"divide-y divide-gray-200 bg-white",children:[s.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"px-6 py-8 text-center text-sm text-gray-400",children:"No recordings in this period."})}),s.map(t=>e.jsxs("tr",{className:"hover:bg-gray-50",children:[e.jsx("td",{className:"whitespace-nowrap px-6 py-4 text-sm font-medium text-gray-900",children:t.clinic_name}),e.jsx("td",{className:"whitespace-nowrap px-6 py-4 text-right text-sm text-gray-500",children:t.user_count}),e.jsx("td",{className:"whitespace-nowrap px-6 py-4 text-right text-sm text-gray-500",children:t.appointment_c
1ount}),e.jsx("td",{className:"whitespace-nowrap px-6 py-4 text-right text-sm text-gray-900",children:t.total_time}),e.jsx("td",{className:"whitespace-nowrap px-6 py-4 text-right text-sm font-medium text-gray-900",children:m(t.total_seconds,c)})]},t.clinic_id))]})]})})]}),e.jsxs("div",{className:"mt-10",children:[e.jsx("h2",{className:"mb-3 text-lg font-semibold text-gray-900",children:"By account"}),e.jsx("div",{className:"overflow-x-auto rounded-lg border",children:e.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[e.jsx("thead",{className:"bg-gray-50",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500",children:"Account"}),e.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500",children:"Organisation"}),e.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium uppercase tracking-wider text-gray-500",children:"Appointments"}),e.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium uppercase tracking-wider text-gray-500",children:"Total time"}),e.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium uppercase tracking-wider text-gray-500",children:"Amount"})]})}),e.jsxs("tbody",{className:"divide-y divide-gray-200 bg-white",children:[a.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"px-6 py-8 text-center text-sm text-gray-400",children:"No recordings in this period."})}),a.map(t=>e.jsxs("tr",{className:"hover:bg-gray-50",children:[e.jsxs("td",{className:"whitespace-nowrap px-6 py-4 text-sm",children:[e.jsx("div",{className:"font-medium text-gray-900",children:t.user_name}),t.user_email&&e.jsx("div",{className:"text-xs text-gray-500",children:t.user_email})]}),e.jsx("td",{className:"whitespace-nowrap px-6 py-4 text-sm text-gray-500",children:t.clinic_name}),e.jsx("td",{className:"whitespace-nowrap px-6 py-4 text-right text-sm text-gray-500",children:t.appointment_count}),e.jsx("td",{className:"whitespace-nowrap px-6 py-4 text-right text-sm text-gray-900",children:t.total_time}),e.jsx("td",{className:"whitespace-nowrap px-6 py-4 text-right text-sm font-medium text-gray-900",children:m(t.total_seconds,c)})]},t.user_id))]})]})})]})]})})]})}export{$ as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.