PageSourceSearch

https://beeplacev2.lovable.app/assets/ContentDetail-F33FVcPl.js

js beeplacev2.lovable.app collected 2026-10-03 03:24:09 UTC 5,207 bytes, 1 lines download raw bytes

1import{ah as z,u as A,b as F,e as G,g as n,j as e,l as $,B as u,ab as K,ai as P,K as _,a1 as q,aN as J,v as Q}from"./index-DgPd4PC_.js";import{C as h,c as p,a as E,b as I}from"./card-DYzJ6ts0.js";import{C as V}from"./CreateContentDialog-DESTe-4k.js";import{A as S}from"./arrow-left-CWBdIlm5.js";import{C as W}from"./calendar-Kus40Hi5.js";import{G as X}from"./globe-DzUNMpz6.js";import{T as Y}from"./tag-CKOv-ZVU.js";import{p as Z,e as ee,f as se}from"./pt-BR-D9D5SaqL.js";import"./radio-group-7LfnfzUo.js";import"./index-fOWmnHvD.js";import"./video-EXzmVBoY.js";import"./smartphone-CgFt_l4K.js";function he(){var b,v,w,C,y,D,k;const{id:l}=z(),o=A(),{t,i18n:B}=F(),{toast:m}=G(),L=B.language==="pt-BR"?Z:ee,[s,T]=n.useState(null),[H,f]=n.useState(!0),[O,g]=n.useState(!1),[d,x]=n.useState(null);n.useEffect(()=>{if(!l)return;(async()=>{f(!0);try{const r=await Q.get(`/beemedia/content-base/${l}`);r.success?T(r.list):m({title:t("beemedia.contentDetail.error"),description:r.message,variant:"destructive"})}catch(r){m({title:t("beemedia.contentDetail.error"),description:r instanceof Error?r.message:t("beemedia.contentDetail.loadError"),variant:"destructive"})}finally{f(!1)}})()},[l,m,t]);const j=()=>{window.history.length>1?o(-1):o("/beemedia/base-content")},c=((b=s==null?void 0:s.publish)==null?void 0:b.image)||null,i=(s==null?void 0:s.image_url)||null;n.useEffect(()=>{x(c||i)},[c,i]);const M=()=>{if(d===c&&i&&i!==c){x(i);return}x(null)},R=a=>{if(!a)return"-";try{return se(new Date(a),"dd/MM/yyyy HH:mm",{locale:L})}catch{return"-"}},U=a=>!a||typeof a!="string"?[]:a.split(",").map(r=>r.trim()).filter(Boolean);if(H)return e.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:e.jsx($,{className:"h-8 w-8 animate-spin text-muted-foreground"})});if(!s)return e.jsxs("div",{className:"space-y-6",children:[e.jsxs(u,{variant:"ghost",onClick:j,className:"gap-2",children:[e.jsx(S,{className:"h-4 w-4"})," ",t("beemedia.contentDetail.back")]}),e.jsx("div",{className:"text-center py-12",children:e.jsx("p",{className:"text-muted-foreground",children:t("beemedia.contentDetail.notFound")})})]});const N=U(s.category_mapping);return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx(u,{variant:"ghost",size:"icon",onClick:j,className:"mt-1 shrink-0",children:e.jsx(S,{className:"h-4 w-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:s.name}),e.jsxs(u,{onClick:()=>g(!0),className:"gap-2 shrink-0",children:[e.jsx(K,{className:"h-4 w-4"}),t("beemedia.contentDetail.createContent")]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3 mt-2 text-sm text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(W,{className:"h-3.5 w-3.5"}),R(s.created_at)]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(X,{className:"h-3.5 w-3.5"}),s.origin||"-"]}),s.author&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(P,{className:"h-3.5 w-3.5"}),s.author]}),((v=s.status)==null?void 0:v.name)&&e.jsx(_,{variant:"outline",className:"text-xs font-normal",children:s.status.name})]})]})]}),d&&e.jsx(h,{children:e.jsx(p,{className:"p-4",children:e.jsx("div",{className:"flex items-center justify-center overflow-hidden rounded-md border border-border/60 bg-muted/20 p-2 sm:p-4",children:e.jsx("img",{src:d,alt:s.name,loading:"lazy",onError:M,className:"block h-auto max-h-[70vh] w-auto max-w-full object-contain"})})})}),N.length>0&&e.jsxs(h,{children:[e.jsx(E,{className:"pb-2",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Y,{className:"h-4 w-4 text-muted-foreground"}),e.jsx(I,{className:"text-sm",children:t("beemedia.contentDetail.categories")})]})}),e.jsx(p,{children:e.jsx("div",{className:"flex flex-wrap gap-2",children:N.map(a=>e.jsx(_,{variant:"secondary",children:a},a))})})]}),((w=s.publish)==null?void 0:w.description)&&e.jsxs(h,{children:[e.jsx(E,{className:"pb-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(q,{className:"h-4 w-4 text-muted-foreground"}),e.jsx(I,{className:"text-sm",children:t("beemedia.contentDetail.fullContent")})]}),(s.publish_origin_url||((C=s.publish)==null?void 0:C.url))&&e.jsxs("a",{href:s.publish_origin_url||((y=s.publish)==null?void 0:y.url),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-xs text-primary hover:underline",children:[t("beemedia.contentDetail.openOriginal")," ",e.jsx(J,{className:"h-3 w-3"})]})]})}),e.jsx(p,{children:e.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none text-sm text-muted-foreground leading-relaxed [&_img]:h-auto [&_img]:max-w-full [&_img]:object-contain",dangerouslySetInnerHTML:{__html:((D=s.publish)==null?void 0:D.description)||""}})})]}),e.jsx(V,{open:O,onOpenChange:g,contentId:l||"",contentImageUrl:s.image_url||((k=s.publish)==null?void 0:k.image),onSuccess:a=>o(`/beemedia/my-contents/${a}`)}
1)]})}export{he 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.