1import{d as b,r as s,j as e,f as g,L as y,t as h}from"./index-BrWsbXFR.js";import{S as w,f as j,A as L,c as S}from"./AuthenticatedLayout-DDm6Lv5H.js";import{E as T}from"./ErrorInfo-8INlVT22.js";import{F as N}from"./FreeTrialOffer-DT_VDbpr.js";import{S as E}from"./SuitabilityLetterList-S_7ESGZv.js";import{B as i}from"./badge-check-BLHU3W4v.js";import"./cn-dyD0JcX9.js";import"./file-text-cqenMAIT.js";import"./users-RRvOMetc.js";import"./building-DWkE16Cg.js";import"./index-DwM0Lmtm.js";import"./sparkles-BdJT3Itm.js";import"./clock-Ch7AuhEx.js";import"./DataTable-E5DyqFkG.js";import"./useConfirm-B_s_vZUu.js";const U=()=>{const{loading:u,subscriptions:m}=b(),[d,f]=s.useState(void 0),[x,r]=s.useState(!1),[o,a]=s.useState(""),[l,n]=s.useState(!1);s.useEffect(()=>{c().catch(t=>{console.error("Failed to load:",t)})},[]);const c=async()=>{r(!0),a("");const t=await w.GetAllSuitabilityLetters();t.success&&t.message?f(t.message):t.success||a(t.error||"Failed to load suitability letters"),r(!1)};if(u||x)return e.jsx(g,{});const p=j(m,["suitability-letter-trial","suitability-letter-basic","suitability-letter-pro"]);return e.jsxs(L,{children:[e.jsx("div",{className:"bg-white shadow-md rounded-lg p-4 space-y-4 md:space-y-8 my-4",children:p?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-center",children:[e.jsxs("h1",{className:"text-2xl md:text-3xl font-bold w-full md:w-auto text-center md:text-left text-gray-800 mb-4 flex-grow",children:[e.jsx(i,{className:"inline mr-2 text-green-600"}),"Suitability Letters"]}),e.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-center gap-2",children:[e.jsxs("button",{onClick:()=>
1n(!0),className:"text-base md:text-lg lg:text-xl cursor-pointer py-2 px-4 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 disabled:opacity-50 flex items-center justify-center w-full md:w-auto",children:[e.jsx(i,{className:"h-5 w-5 mr-2"}),"Create New Suitability Letter"]}),e.jsxs(y,{to:"/user/templates",className:"text-base md:text-lg lg:text-xl cursor-pointer py-2 px-4 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 disabled:opacity-50 flex items-center justify-center w-full md:w-auto",children:[e.jsx(i,{className:"h-5 w-5 mr-2"}),"Manage Templates"]})]})]}),o&&e.jsx(T,{error:o}),e.jsx(E,{letters:d,fetchLetters:c})]}):e.jsx(N,{title:"Suitability Letters",description:"Generate professional suitability letters for your clients using AI-powered technology with customizable templates and compliance features.",productType:h.SUITABILITY_LETTER_TRIAL,color:"green",actionIcon:e.jsx(i,{className:"h-5 w-5"}),actionText:"Start Free Trial"})}),l&&e.jsx(S,{isOpen:l,onClose:()=>n(!1)})]})};export{U 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.