1import{_ as u,a as o,i as j}from"./vendor-DrhYhv1J.js";import{t as g}from"./arrow-left-BiN_aeI6.js";import{n as r,t as f}from"./admin-layout-Xzi4Ld8h.js";import{t as p}from"./download-DWeCCRtX.js";import{t as N}from"./pencil-BOoIDSW3.js";import{ct as x}from"./app-DkW1paqt.js";import{t as l}from"./badge--qZBAdZg.js";import{a as w,i as v,n as b,t as _}from"./page-toolbar-BaM6JRQ9.js";import{a as i,n as t,o as d,r as y,t as m}from"./card-svQjEXix.js";import{n as h,t as a}from"./stat-box-BwwUURfl.js";var e=u();function c(s){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(s)}function C(s){switch(s){case"active":return(0,e.jsx)(l,{className:"bg-green-500/10 text-green-600 hover:bg-green-500/10 dark:text-green-400",children:"Active"});case"expired":return(0,e.jsx)(l,{variant:"secondary",children:"Expired"});case"cancelled":return(0,e.jsx)(l,{variant:"destructive",children:"Cancelled"});default:return(0,e.jsx)(l,{variant:"outline",children:s})}}function S(s){switch(s){case"monthly":return"Monthly";case"annually":return"Annually";case"one_time":return"One-time";default:return s}}function E({contract:s}){return(0,e.jsxs)(f,{children:[(0,e.jsx)(j,{title:`Contract â ${s.organisation.name}`}),(0,e.jsxs)("div",{className:"flex w-full flex-col gap-5 p-4 sm:p-6 lg:gap-7 lg:p-8",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,e.jsxs)(o,{href:r.contracts.index(),className:"inline-flex items-center gap-1 self-start text-sm text-muted-foreground hover:text-foreground",children:[(0,e.jsx)(g,{className:"h-4 w-4"}),"Back to Contracts"]}),(0,e.jsxs)(_,{className:"pb-0",children:[(0,e.jsx)(v,{children:(0,e.jsx)(w,{children:(0,e.jsxs)("span",{className:"flex items-center gap-3",children:[s.organisation.name,C(s.status)]})})}),(0,e.jsxs)(b,{children:[(0,e.jsx)(x,{variant:"outline",asChild:!0,children:(0,e.jsxs)("a",{href:r.contracts.invoice(s.id),children:[(0,e.jsx)(p,{className:"mr-2 h-4 w-4"}),"Download Invoice"]})}),(0,e.jsx)(x,{asChild:!0,children:(0,e.jsxs)(o,{href:r.contracts.edit(s.id),children:[(0,e.jsx)(N,{className:"mr-2 h-4 w-4"}),"Edit Contract"]})})]})]})]}),(0,e.jsxs)("div",{className:"grid gap-5 lg:grid-cols-3 lg:gap-7",children:[(0,e.jsxs)(m,{className:"lg:col-span-2",children:[(0,e.jsx)(i,{children:(0,e.jsx)(d,{children:"Billing Details"})}),(0,e.jsxs)(t,{children:[(0,e.jsxs)(h,{children:[(0,e.jsx)(a,{className:"min-w-36 grow",value:c(s.monthly_amount),label:"Monthly Amount (MRR)"}),s.annual_amount&&(0,e.jsx)(a,{className:"min-w-36 grow",value:c(s.annual_amount),label:"Annual Amount"}),s.onboarding_fee&&(0,e.jsx)(a,{className:"min-w-36 grow",value:c(s.onboarding_fee),label:"Onboarding & Training Fee · One-time"}),s.ats_monthly_credits!==null?(0,e.jsx)(a,{className:"min-w-36 grow",value:s.ats_monthly_credits.toLocaleString(),label:"ATS Credits / Month"}):(0,e.jsx)(a,{className:"min-w-36 grow",value:s.seats,label:"Seats"}),(0,e.jsx)(a,{className:"min-w-36 grow",value:S(s.billing_type),label:"Billing Type"})]}),(0,e.jsxs)(h,{className:"mt-2.5",children:[(0,e.jsx)(a,{className:"min-w-36 grow",value:s.start_date,label:"Start Date"}),(0,e.jsx)(a,{className:"min-w-36 grow",value:s.end_date??"Ongoing",label:"End Date"})]})]})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-5 lg:gap-7",children:[(0,e.jsxs)(m,{children:[(0,e.jsx)(i,{children:(0,e.jsx)(d,{className:"text-sm",children:"Details"})}),(0,e.jsxs)(t,{className:"space-y-3 text-sm",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-muted-foreground",children:"Organisation"}),(0,e.jsx)(o,{href:r.tenants.show(s.organisation.id),className:"font-medium hover:underline",children:s.organisation.name})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-muted-foreground",children:"Created by"}),(0,e.jsx)("p",{className:"font-medium",children:s.created_by?.name??"System"})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-muted-foreground",children:"Created"}),(0,e.jsx)("p",{className:"font-medium",children:s.created_at})]})]})]}),(0,e.jsxs)(m,{children:[(0,e.jsxs)(i,{children:[(0,e.jsxs)(d,{className:"text-sm",children:["Modules (",s.modules.length,")"]}),(0,e.jsx)(y,{children:s.ats_monthly_credits!==null?"Recruiting-only bundle provisioned with this contract":"Included in this contract"})]}),(0,e.jsx)(t,{children:(0,e.jsx)("div",{className:"flex flex-wrap gap-2",children:s.modules.map(n=>(0,e.jsxs)(l,{variant:"secondary",children:[n.name,n.tier_label&&(0,e.jsxs)("span",{className:"ml-1 text-muted-foreground",children:["(",n.tier_label,")"]})]},n.key))})})]})]})]}),s.notes&&(0,e.jsxs)(m,{children:[(0,e.jsx)(i,{children:(0,e.jsx)(d,{children:"Notes"})}),(0,e.jsx)(t,{children:(0,e.jsx)("p",{className:"text-sm whitespace-pre-wrap",children:s.notes})})]})]})]})}export{E 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.