Files
boc/backups/2026-07-12-1023/landvex-prod/assets/Index-B5xg3G3P.js
T

2 lines
12 KiB
JavaScript
Raw Normal View History

import{r as u,u as W,a as R,j as e,T as I,M as N,f as J,C as M,b as K,c as w,P as y,d as Q,R as d,e as X,g as Y,h as Z,i as C,k as ee,l as se,m as ae,L as P,n as te,B as re}from"./index-oAPVDf-r.js";import{R as oe}from"./refresh-cw-DEBvxUr1.js";import{C as k}from"./clock-DRtqJZUo.js";import{C as ne}from"./chevron-right-B9rMgght.js";import{c as S,I as le,R as ie}from"./index-DGH-oZ97.js";import{C as ce}from"./circle-alert-C1Hs9zwh.js";import{V as de}from"./video-D6Sip5Dx.js";const b=u.memo(u.forwardRef(({mission:s,userReach:t=5e3},o)=>{const r=W(),{t:a}=R(),l=s.distance!==void 0&&s.distance<=t,n=l&&s.distance!==void 0&&s.distance<=s.radius_meters,i=c=>{switch(c){case"daily":return a("common.daily");case"weekly":return a("common.weekly");case"biweekly":return a("common.biweekly");case"monthly":return a("common.monthly");default:return c}};return e.jsx("div",{ref:o,onClick:()=>r(`/mission/${s.id}`),className:"glass-card p-5 cursor-pointer hover:border-primary/50 active:scale-[0.98] transition-all duration-200 group touch-target",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.organization&&e.jsx("span",{className:"text-xs text-muted-foreground bg-secondary/50 px-2.5 py-1.5 rounded-lg",children:s.organization.name}),s.area_name&&e.jsxs("span",{className:"text-xs text-muted-foreground bg-secondary/50 px-2.5 py-1.5 rounded-lg flex items-center gap-1.5",children:[e.jsx(I,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsx("span",{className:"truncate max-w-[140px]",children:s.area_name})]}),n&&e.jsx("span",{className:"text-xs bg-success/20 text-success px-2.5 py-1.5 rounded-lg animate-pulse font-medium",children:a("common.available")})]}),e.jsx("h3",{className:"font-semibold text-base text-foreground group-hover:text-primary transition-colors leading-snug",children:s.title}),s.description&&e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 leading-relaxed",children:s.description}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-2.5 text-xs text-muted-foreground pt-1",children:[s.distance!==void 0&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(N,{className:"w-4 h-4 text-primary flex-shrink-0"}),e.jsx("span",{className:`font-medium ${l?"text-primary":"text-destructive"}`,children:J(s.distance)})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(M,{className:"w-4 h-4 flex-shrink-0"}),e.jsxs("span",{children:[s.required_photos," ",a("common.photos")]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(K,{className:"w-4 h-4 text-warning flex-shrink-0"}),e.jsxs("span",{className:"text-warning font-semibold",children:[new Intl.NumberFormat("sv-SE").format(s.reward_credits)," ",a("common.sek")]})]}),s.frequency&&s.frequency!=="once"&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(oe,{className:"w-4 h-4 text-primary flex-shrink-0"}),e.jsx("span",{className:"text-primary font-medium",children:i(s.frequency)})]}),s.active_until&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(k,{className:"w-4 h-4 flex-shrink-0"}),e.jsxs("span",{children:[a("common.until")," ",new Date(s.active_until).toLocaleDateString("sv-SE")]})]}),!s.active_until&&s.expires_at&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(k,{className:"w-4 h-4 flex-shrink-0"}),e.jsx("span",{children:new Date(s.expires_at).toLocaleDateString("sv-SE")})]})]})]}),e.jsx("div",{className:"flex items-center justify-center w-10 h-10 rounded-full bg-secondary/50 group-hover:bg-primary/20 transition-colors flex-shrink-0 self-center",children:e.jsx(ne,{className:"w-5 h-5 text-muted-foreground group-hover:text-primary transition-colors"})})]})})}));b.displayName="MissionCard";var E="Toggle",G=u.forwardRef((s,t)=>{const{pressed:o,defaultPressed:r,onPressedChange:a,...l}=s,[n,i]=w({prop:o,onChange:a,defaultProp:r??!1,caller:E});return e.jsx(y.button,{type:"button","aria-pressed"