PageSourceSearch

https://careers.today/assets/Favorites-1XBMzxyt.js

js careers.today collected 2026-10-02 16:08:05 UTC 11,307 bytes, 1 lines download raw bytes

1import{c as j,r as y,j as e,K as x,J as w,L as o,f as N,aU as k,y as T,P as u,aV as U}from"./index-KH-HvksM.js";import{O as C}from"./OnetAttribution-Btn3jgy0.js";import{T as D,a as L,b as c,c as m}from"./tabs-3hAdZOEA.js";import{F as P}from"./FavoriteButton-CeDgggys.js";import{D as F}from"./DislikeButton-BS7mmfAF.js";import{T as b,u as E}from"./use-dislike-BGI6QbDk.js";import{m as h}from"./proxy-CoY8ju7v.js";import"./use-favorite-dVdATPnr.js";const I=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],S=j("undo-2",I),$=[{value:"all",label:"All"},{value:"career",label:"Job Types"},{value:"industry",label:"Industry"},{value:"problem",label:"Problem"},{value:"company",label:"Company"},{value:"college",label:"University"}];function J({value:t,onChange:s}){return e.jsx("div",{className:"flex flex-wrap items-center gap-1.5",children:$.map(r=>e.jsx("button",{type:"button",onClick:()=>s(r.value),className:t===r.value?"px-3 py-1.5 rounded-full text-[13px] font-semibold bg-[var(--ct-blue-900)] text-white transition-colors":"px-3 py-1.5 rounded-full text-[13px] font-semibold bg-white border border-[var(--ct-border-subtle)] text-[var(--ct-text-secondary)] hover:border-[var(--ct-blue-500)] hover:text-[var(--ct-blue-900)] transition-colors",children:r.label},r.value))})}function G(){const[t,s]=y.useState("all");return e.jsxs("div",{className:"relative left-1/2 -translate-x-1/2 w-screen bg-[var(--ct-background-soft)] min-h-screen pb-24",children:[e.jsx("div",{className:"bg-white border-b border-[var(--ct-border-subtle)] pt-10 pb-10 md:pt-12 md:pb-12",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-6",children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-[var(--ct-blue-500)] mb-3",children:"Your Collection"}),e.jsx("h1",{className:"text-3xl md:text-4xl font-semibold text-[var(--ct-blue-950)] tracking-tight leading-[1.1] mb-4",children:"Your Favorites"}),e.jsx("p",{className:"text-[15px] text-gray-600 max-w-2xl",children:"Job types, companies, and ideas you've favorited for later — plus anything you've hidden."})]})}),e.jsxs("div",{className:"max-w-5xl mx-auto px-6 mt-8 md:mt-10",children:[e.jsxs(D,{defaultValue:"favorites",children:[e.jsxs("div",{className:"mb-6 flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[e.jsxs(L,{className:"bg-white border border-[var(--ct-border-subtle)] rounded-md p-1 h-auto shadow-sm w-fit self-start",children:[e.jsxs(c,{value:"favorites",className:"gap-2 rounded px-4 py-2 text-sm font-semibold text-[var(--ct-text-secondary)] data-[state=active]:bg-[var(--ct-blue-900)] data-[state=active]:text-white data-[state=active]:shadow-none",children:[e.jsx(x,{className:"h-4 w-4"}),"Favorites"]}),e.jsxs(c,{value:"disliked",className:"gap-2 rounded px-4 py-2 text-sm font-semibold text-[var(--ct-text-secondary)] data-[state=active]:bg-[var(--ct-blue-900)] data-[state=active]:text-white data-[state=active]:shadow-none",children:[e.jsx(b,{className:"h-4 w-4"}),"Disliked"]})]}),e.jsx(J,{value:t,onChange:s})]}),e.jsx(m,{value:"favorites",children:e.jsx(A,{typeFilter:t})}),e.jsx(m,{value:"disliked",children:e.jsx(K,{typeFilter:t})})]}),e.jsx(C,{})]})]})}function p({title:t}){return e.jsxs("div",{className:"bg-white p-8 text-center border border-[var(--ct-danger)]/30 rounded-md shadow-sm mb-8",children:[e.jsx("h3",{className:"font-semibold text-[var(--ct-danger)] mb-2 text-lg",children:t}),e.jsx("p",{className:"text-gray-600",children:"We couldn't reach the server. Please try again."})]})}function A({typeFilter:t}){const{data:s,isLoading:r,isError:d}=w(),l=t==="all"?s:s?.filter(a=>a.targetType===t);return d?e.jsx(p,{title:"Failed to load favorites"}):r?e.jsx(v,{}):e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[l?.map((a,i)=>e.jsx(h.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{delay:i*.05,duration:.3},children:e.jsx(W,{favorite:a})},a.id)),l?.length===0&&t!=="all"&&e.jsx("div",{className:"col-span-full py-16 text-center text-[var(--ct-text-muted)]",children:"No favorites of this type yet."}),l?.length===0&&t==="all"&&e.jsx("div",{className:"col-span-full py-16",children:e.jsxs("div",{className:"bg-white p-12 text-center rounded-md border border-[var(--ct-border-subtle)] shadow-sm max-w-lg mx-auto",children:[e.jsx("div",{className:"w-14 h-14 roun
1ded-full bg-[var(--ct-sky-100)] flex items-center justify-center mx-auto mb-5",children:e.jsx(x,{className:"h-7 w-7 text-[var(--ct-blue-600)]"})}),e.jsx("h3",{className:"text-xl font-semibold text-[var(--ct-blue-950)] mb-2",children:"No favorites yet"}),e.jsx("p",{className:"text-gray-600 mb-8",children:"When you explore job types and companies, favorite the ones you like to build your personal path."}),e.jsx(o,{href:"/discover",children:e.jsx("div",{className:"inline-flex items-center justify-center rounded-md font-semibold bg-[var(--ct-blue-800)] px-6 py-3 text-white hover:bg-[var(--ct-blue-900)] transition-colors cursor-pointer shadow-sm",children:"Start Exploring"})})]})})]})}function K({typeFilter:t}){const{isSignedIn:s}=N(),{data:r,isLoading:d,isError:l}=k({query:{enabled:!!s,queryKey:U()}}),a=t==="all"?r:r?.filter(i=>i.targetType===t);return l?e.jsx(p,{title:"Failed to load your disliked items"}):d?e.jsx(v,{}):e.jsxs("div",{children:[a&&a.length>0&&e.jsx("p",{className:"text-sm text-gray-600 mb-6",children:"These are hidden from your Discover feed and ranked last in matches. Undo a dislike to bring one back."}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[a?.map((i,f)=>e.jsx(h.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{delay:f*.05,duration:.3},children:e.jsx(Y,{dislike:i})},i.id)),(!a||a.length===0)&&t!=="all"&&e.jsx("div",{className:"col-span-full py-16 text-center text-[var(--ct-text-muted)]",children:"Nothing disliked of this type."}),(!a||a.length===0)&&t==="all"&&e.jsx("div",{className:"col-span-full py-16",children:e.jsxs("div",{className:"bg-white p-12 text-center rounded-md border border-[var(--ct-border-subtle)] shadow-sm max-w-lg mx-auto",children:[e.jsx("div",{className:"w-14 h-14 rounded-full bg-[var(--ct-background-muted)] flex items-center justify-center mx-auto mb-5",children:e.jsx(b,{className:"h-7 w-7 text-[var(--ct-text-muted)]"})}),e.jsx("h3",{className:"text-xl font-semibold text-[var(--ct-blue-950)] mb-2",children:"Nothing disliked"}),e.jsx("p",{className:"text-gray-600",children:"When you thumbs-down a career, company, industry, or problem, it will show up here so you can change your mind later."})]})})]})]})}function n(t){return t==="career"?"Job Type":t==="college"?"University":t.charAt(0).toUpperCase()+t.slice(1)}function g(t,s){return t==="career"?`/careers/${s}`:t==="company"?`/try/companies/${s}`:t==="industry"?`/industries/${s}`:t==="problem"?`/problems/${s}`:"/"}function R({label:t}){return e.jsx("span",{className:"inline-flex items-center px-2.5 py-1 rounded-md bg-[var(--ct-sky-100)] text-[var(--ct-blue-800)] text-xs font-semibold uppercase tracking-wider border border-[var(--ct-sky-200)]/40",children:t})}function W({favorite:t}){const s=g(t.targetType,t.targetId);return e.jsx(o,{href:s,onClick:t.targetType==="company"?()=>u(t.title):void 0,children:e.jsxs("div",{className:"h-full flex flex-col overflow-hidden rounded-md group cursor-pointer transition-all hover:shadow-md bg-white border border-[var(--ct-border-subtle)] shadow-sm relative",children:[e.jsx(P,{targetType:t.targetType,targetId:t.targetId,size:"md"}),e.jsx(F,{targetType:t.targetType,targetId:t.targetId,size:"md"}),t.imageUrl?e.jsx("div",{className:"h-32 w-full overflow-hidden bg-[var(--ct-background-muted)] relative",children:e.jsx("img",{src:t.imageUrl,alt:t.title,className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"})}):e.jsx("div",{className:"h-24 w-full bg-[var(--ct-sky-100)]/50 flex items-center justify-between p-4 relative",children:e.jsx(R,{label:n(t.targetType)})}),e.jsxs("div",{className:"p-5 flex-grow flex flex-col",children:[e.jsxs("div",{className:"flex-grow",children:[e.jsx("h3",{className:"text-lg font-semibold tracking-tight text-[var(--ct-blue-950)] mb-1 line-clamp-1",children:t.title}),t.subtitle&&e.jsx("p",{className:"text-sm text-gray-600 line-clamp-2",children:t.subtitle})]}),e.jsxs("div",{className:"pt-4 mt-2 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-semibold text-[var(--ct-text-muted)] uppercase tracking-wider",children:t.imageUrl&&n(t.targetType)}),e.jsx("div",{className:"h-8 w-8 rounded-full bg-[var(--ct-sky-100)] group-hover:bg-[var(--ct-blue-800)] group-hover:text-white text-[var(--ct-blue-800)] flex items-center justify-center transition-colors",children:e.jsx(T,{className:"h-4 w-4"})})]})]})]})})}function Y({dislike:t}){const s=g(t.targetType,t.targetId),{isPending:r,toggle:d}=E(t.targetType,t.targetId);return e.jsx(o,{href:s,onClick:t.targetType==="company"?()=>u(t.title):void 0,children:e.jsxs("div",{className:"h-full flex flex-col overflow-hidden rounded-md group cursor-pointer transition-all hover:shadow-md bg-white border border-[var(--ct-border-subtle)] shadow-sm relative",children:[t.imageUrl?e.jsx("div",{className:"h-32 w-full overflow-hidden bg-[var(--ct-background-muted)] relative",children:e.jsx("img",{src:t.imageUrl,alt:t.title,className:"w-full h-full object-cover grayscale opacity-80 transition-transform duration-500 group-hover:scale-105"})}):e.jsx("div",{className:"h-24 w-full bg-[var(--ct-background-muted)]/60 flex items-center justify-between p-4 relative",children:e.jsx("span",{className:"inline-flex items-center px-2.5 py-1 rounded-md bg-[var(--ct-background-muted)] text-[var(--ct-text-muted)] text-xs font-semibold uppercase tracking-wider",children:n(t.targetType)})}),e.jsxs("div",{className:"p-5 flex-grow flex flex-col",children:[e.jsxs("div",{className:"flex-grow",children:[e.jsx("h3",{className:"text-lg font-semibold tracking-tight text-[var(--ct-blue-950)] mb-1 line-clamp-1",children:t.title}),t.subtitle&&e.jsx("p",{className:"text-sm text-gray-600 line-clamp-2",children:t.subtitle})]}),e.jsxs("div",{className:"pt-4 mt-2 flex items-center justify-between gap-3",children:[e.jsx("span",{className:"text-xs font-semibold text-[var(--ct-text-muted)] uppercase tracking-wider",children:n(t.targetType)}),e.jsxs("button",{type:"button",disabled:r,onClick:l=>{l.preventDefault(),l.stopPropagation(),d()},className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-md border border-[var(--ct-border-subtle)] bg-white text-sm font-semibold text-gray-600 hover:bg-[var(--ct-background-muted)] hover:text-[var(--ct-blue-900)] transition-colors shadow-sm disabled:opacity-50","aria-label":`Undo dislike of ${t.title}`,children:[e.jsx(S,{className:"h-3.5 w-3.5"}),"Undo dislike"]})]})]})]})})}function v(){return e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 animate-pulse",children:[e.jsx("div",{className:"h-48 rounded-md bg-[var(--ct-background-muted)]"}),e.jsx("div",{className:"h-48 rounded-md bg-[var(--ct-background-muted)]"}),e.jsx("div",{className:"h-48 rounded-md bg-[var(--ct-background-muted)]"})]})}
1export{G 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.