1import{r as c,j as e}from"./index-BDIM6IFg.js";function m(){const[t,i]=c.useState({year:"",imgSrc:"",pdfSrc:""}),[l,n]=c.useState(!0);return c.useEffect(()=>{(async()=>{try{const r=await fetch("https://iiitn.ac.in/api/media/media/category/fee");if(!r.ok)throw new Error("Failed to fetch academic fee data");const a=(await r.json()).find(s=>s.m_sub_category==="hostel_fee");if(a){const s={year:a.title,imgSrc:a==null?void 0:a.media_img_id,pdfSrc:a==null?void 0:a.media_doc_id};i(s)}else console.warn("No academic fee data found.")}catch(r){console.error("Error fetching academic fee data:",r)}finally{n(!1)}})()},[]),l?e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsx("div",{className:"animate-spin rounded-full h-32 w-32 border-t-2 border-b-2 border-primary"})}):e.jsxs("div",{className:"bg-gray-100 min-h-screen flex flex-col",children:[e.jsx("header",{className:"bg-primary text-white py-14 text-center",children:e.jsx("h1",{className:"text-3xl font-bold",children:"Hostel Fees"})}),e.jsxs("main",{className:"max-w-4xl mx-auto p-6 bg-white shadow-lg rounded-lg mt-8",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-800 text-center mb-4",children:t.year}),e.jsx("div",{className:"flex justify-center",children:t.imgSrc?e.jsx("img",{src:t.imgSrc,alt:`Hostel Fee Structure for ${t.year}`,className:"max-w-full h-auto rounded-lg shadow-md"}):t.pdfSrc?e.jsxs("a",{href:t.pdfSrc,className:"inline-block px-6 py-3 text-white bg-blue-600 rounded-lg shadow-lg hover:bg-blue-700 transition duration-300",target:"_blank",rel:"noopener noreferrer",children:[e.jsx("i",{className:"fas fa-file-pdf mr-2"})," Download PDF"]}):e.jsx("p",{className:"text-red-500",children:"No image or PDF available"})}),e.jsx("div",{className:"flex flex-col sm:flex-row gap-4 mt-6 justify-center",children:e.jsx("a",{href:"/pages/hostelfeepayment",className:"bg-green-600 text-white px-5 py-2 rounded-md text-center hover:bg-green-700 transition",children:"Hostel Fee Payment Details"})})]})]})}export{m 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.