PageSourceSearch

https://diveos.pro/assets/DiveSitesPage-Cwa5Fiu-.js

js diveos.pro collected 2026-10-09 22:03:34 UTC 2,547 bytes, 1 lines download raw bytes

1import{u as v,r as t,j as e,B as h,E as i,af as f,e as N}from"./index-C8n-dv4k.js";import{I as r}from"./input-Db8KoBTY.js";import{D,a as S,b as y,c as C,d as R}from"./dialog-66nD1cLG.js";import{P as b}from"./plus-BbXKZIBR.js";import{W as g}from"./waves-YaaS5GVa.js";function E(){const{diveSites:d,addDiveSite:u,updateDiveSite:w}=v(),[j,n]=t.useState(!1),[a,l]=t.useState(""),[c,o]=t.useState(""),[m,x]=t.useState(""),p=async()=>{if(a.trim()){try{await u({id:crypto.randomUUID(),name:a.trim(),region:c||void 0,depthRange:m||void 0,active:!0})}catch{return}N.success(`${a} added`),l(""),o(""),x(""),n(!1)}};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Dive Sites"}),e.jsxs(D,{open:j,onOpenChange:n,children:[e.jsx(S,{asChild:!0,children:e.jsxs(h,{className:"touch-target",children:[e.jsx(b,{size:18})," Add Site"]})}),e.jsxs(y,{children:[e.jsx(C,{children:e.jsx(R,{children:"Add Dive Site"})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(i,{children:"Site Name"}),e.jsx(r,{value:a,onChange:s=>l(s.target.value),placeholder:"Twin Reef"})]}),e.jsxs("div",{children:[e.jsx(i,{children:"Region"}),e.jsx(r,{value:c,onChange:s=>o(s.target.value),placeholder:"North Coast"})]}),e.jsxs("div",{children:[e.jsx(i,{children:"Depth Range"}),e.jsx(r,{value:m,onChange:s=>x(s.target.value),placeholder:"5-18m"})]}),e.jsx(h,{onClick:p,className:"w-full",children:"Add Site"})]})]})]})]}),d.length===0?e.jsx("div",{className:"ops-card text-center py-12 text-muted-foreground",children:"No dive sites added yet"}):e.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:d.map(s=>e.jsxs("div",{className:"ops-card flex items-center gap-3 p-3",children:[s.imageUrl?e.jsx("img",{src:s.imageUrl,alt:s.name,className:"w-14 h-14 rounded-lg object-cover shrink-0",loading:"lazy"}):e.jsx("div",{className:"w-14 h-14 rounded-lg bg-muted flex items-center justify-center shrink-0",children:e.jsx(g,{size:20,className:"text-muted-foreground/30"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"font-bold text-sm truncate",children:s.name}),s.region&&e.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[e.jsx(f,{size:11})," ",s.region]}),s.depthRange&&e.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[e.jsx(g,{size:11})," ",s.depthRange]})]})]},s.id))})]})}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.