PageSourceSearch

https://app.dabud.ai/assets/recommendations-list-page-pnM6yFWe.js

js dabud.ai collected 2026-10-05 11:57:34 UTC 7,421 bytes, 1 lines download raw bytes

1import{u,j as e}from"./vendor-query-C3n6aBVz.js";import{r as f,L as j,f as N,l as g}from"./vendor-react-B8sFgQWj.js";import{b as y,a as v,L as w}from"./list-BDr6AjD0.js";import{A as b,b as C}from"./alert-I5KQefSe.js";import{x as S,H as k,a as T,aO as L,aP as R,b1 as D,b2 as q,R as x,V as I,W as P,Z as M,B as A,af as i,a2 as F,bc as H,C as O,aL as z,aN as B}from"./index-HlZn4L0Y.js";import{S as E,a as _}from"./scroll-area-DRF4RIAN.js";import{B as p}from"./badge-BhkJ4kRx.js";import{s as $,a as m,a7 as U}from"./vendor-ra-6Wm6zczP.js";import{C as h,a as G,b as V,e as W}from"./card-BeEU1ArI.js";import{f as Z,C as J}from"./format-ajye_aPk.js";import{T as K}from"./trending-up-G0_FYoSo.js";import{L as Q}from"./lightbulb-DAAxfavw.js";import"./vendor-recharts-DdT53m7E.js";import"./ellipsis-CPABsJq5.js";import"./select-OarYOxNR.js";import"./index-BdQq_4o_.js";import"./index-CdIh_Gys.js";import"./chevron-left-Dm-eVsxP.js";import"./folder-open-DQy3P1Pl.js";import"./resource-header-BJmpUFax.js";import"./vendor-motion-v5gcm5ma.js";const X=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Y=S("clock",X);function ee(s){return{method:"POST",url:`/api/v1/implementation-requests/recommendation/${s}`}}async function se(s,t={}){const{client:a=k,...r}=t;return(await a({method:"POST",url:ee(s).url.toString(),...r})).data}const te=({recommendationId:s,onClose:t})=>{const a=$(),r=m(),[c,l]=f.useState(!1),{data:n,isPending:d}=T("recommendations",s,{enabled:!!s});return u({mutationFn:o=>se(o),onSuccess:()=>{a(r("recommendations.details.implementationRequestSubmitted"),{type:"success"}),t()},onError:o=>{a(r("recommendations.details.implementationRequestFailed"),{type:"error"}),console.error("Failed to create implementation request:",o)},onSettled:()=>{l(!1)}}),d?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx("div",{className:"text-muted-foreground",children:r("recommendations.details.loading")})}):n?e.jsxs("div",{className:"p-4 md:p-6  flex flex-col gap-4",children:[e.jsxs(L,{className:"mb-4",children:[e.jsx("div",{className:"flex items-start gap-2 flex-wrap mb-1",children:n.tags.map(o=>e.jsx(p,{variant:"secondary",className:"text-xs",children:o.name},o.id))}),e.jsx(R,{className:"text-2xl",children:n.name}),e.jsxs(D,{className:"",children:[r("recommendations.details.expectedImpact"),":"," ",n.expectedImpact]})]}),e.jsx("div",{className:"space-y-4",children:e.jsx("div",{className:"prose dark:prose-invert max-w-none",dangerouslySetInnerHTML:{__html:n.description}})}),e.jsx("div",{className:"border-t px-4 py-3 my-4 border rounded-md border-accent bg-accent/30",children:e.jsx("p",{className:"text-md",children:r("recommendations.details.implementationPrompt")})}),e.jsx(q,{className:"flex-col sm:flex-row gap-2"})]}):e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx("div",{className:"text-muted-foreground",children:r("recommendations.details.notFound")})})};function ae(s){try{const t=new Date(s);return Z(t,"MMM d, yyyy")}catch{return""}}function re(s){const t=Number.parseFloat(s);if(Number.isNaN(t))return s;if(t<0)return"";if(t<=48){const r=Math.round(t);return r===1?"1 hour":`${r} hours`}const a=Math.round(t/24);return a===1?"1 day":`${a} days`}const ne=({recommendation:s})=>{const t=m();return e.jsx(j,{to:x.recommendations.show({id:s.id}),children:e.jsxs(h,{className:"hover:shadow-md hover:border-primary/50 gap-2 dark:hover:border-primary/40 transition-all duration-200 max-sm:gap-3 py-4",children:[e.jsxs(G,{className:"flex flex-row items-start justify-between",children:[e.jsx(V,{className:"text-md font-semibold leading-tight text-foreground group-hover:text-primary transition-colors",children:s.name}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground flex-nowrap text-nowrap",children:[e.jsx(J,{className:"size-3.5 max-sm:hidden"}),e.jsx("span",{children:ae(s.createdAt)})]})]}),e.jsxs(W,{className:"items-end",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 text-xs text-muted-foreground",children:[e.jsxs(I,{children:[e.jsx(P,{children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Y,{className:"size-3.5"}),e.jsx("span",{children:re(s.implementationTime)})]})}),e.jsx(M,{children:e.jsx("p",{children:t("recommendations.tooltips.implementationTime")})})]}),e.jsxs("div",{className:"flex items-start gap-2 text-sm text-muted-foreground",children:[e.jsx(K,{className:"size-4 shrink-0 mt-0.5 max-sm:hidden"}),e.jsx("p",{className:"line-clamp-2",children:s.expectedImpact})]}),s.tags.length>0&&e.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:s.tags.map(a=>e.jsx(p,{variant:"secondary",className:"text-xs font-medium",children:a.name},a.id))})]}),e.jsx("div",{className:"ml-auto flex flex-row items-center justify-between gap-3 shrink-0",children:e.jsx("div",{className:"flex gap-2",children:e.jsx(A,{variant:"outline",size:"sm",className:"pointer-events-none",onClick:a=>a.preventDefault(),children:t("recommendations.actions.read")})})})]})]})})},ie=()=>e.jsx(h,{children:e.jsx("div",{className:"p-5 sm:p-6",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",children:[e.jsx(i,{className:"h-5 w-16"}),e.jsx(i,{className:"h-5 w-20"})]}),e.jsx(i,{className:"h-6 w-3/4"}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(i,{className:"size-4 shrink-0 mt-0.5"}),e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx(i,{className:"h-4 w-full"}),e.jsx(i,{className:"h-4 w-2/3"})]})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx(i,{className:"h-4 w-20"}),e.jsx(i,{className:"h-4 w-24"})]})]}),e.jsxs("div",{className:"flex flex-col items-end gap-3 shrink-0",children:[e.jsx(i,{className:"h-8 w-20"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(i,{className:"h-9 w-16"}),e.jsx(i,{className:"h-9 w-16"})]})]})]})})}),oe=()=>{const{data:s,isPending:t}=U(),a=N("/recommendations/:id"),r=g(),c=m(),l=()=>{r(x.recommendations.list())};return t?e.jsx("div",{className:"flex flex-col gap-3 mt-2",children:Array.from({length:6}).map((n,d)=>e.jsx(ie,{},`skeleton-${d}`))}):e.jsxs(e.Fragment,{children:[e.jsxs(b,{className:"mb-4 md:mb-8 text-yellow-500",children:[e.jsx(O,{className:"h-4 w-4"}),e.jsx(C,{children:c("recommendations.list.implementationHelp")})]}),e.jsx("div",{className:"flex flex-col gap-3 mt-2",children:s?.map(n=>e.jsx(ne,{recommendation:n},n.id))}),e.jsx(z,{open:!!a?.params.id,onOpenChange:n=>!n&&l(),children:e.jsx(B,{className:"md:max-w-3xl w-full max-h-[calc(100dvh-2rem)] overflow-hidden flex flex-col p-0",children:e.jsxs(E,{className:"flex-1 overflow-y-auto",children:[a?.params.id&&e.jsx(te,{recommendationId:a.params.id,onClose:l}),e.jsx(_,{orientation:"vertical"})]})})})]})},Re=()=>{const{data:s}=F(),t=m();return e.jsx(H,{children:e.jsx(y,{resource:"recommendations",sort:{field:"name",order:"ASC"},filter:{projectId:s?.id,noSort:!0},perPage:12,empty:e.jsx(w,{icon:e.jsx(Q,{}),title:t("recommendations.empty.title"),description:t("recommendations.empty.description")}),error:e.jsx(v,{description:t("recommendations.error.description")}),queryOptions:{enabled:!!s?.id},description:t("recommendations.list.description"),children:e.jsx(oe,{})})})};export{Re as RecommendationsListPage};

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.