PageSourceSearch

https://vjbooking.com/assets/ArtistLikeButton-Bap__ZTt.js

js vjbooking.com collected 2026-10-03 00:34:14 UTC 3,979 bytes, 1 lines download raw bytes

1import{u as F,r as u,j as s,e as l,B as o,H as b,p as y,q as P,t as A,v as L,w as S,x as H}from"./index-BVjyonOd.js";import{u as K}from"./useLikes-UyOGoyo9.js";import{u as _}from"./useCollections-CvPopPIb.js";import{F as z,C as O}from"./CollectionThumbnail-GlGlaV_j.js";import{P as E}from"./plus-DUf3tQJl.js";const Q=({artistId:r,variant:I="icon",className:h})=>{const{user:g}=F(),{isArtistLiked:T,toggleArtistLike:B}=K(),{collections:i,createCollection:D,addToCollection:N}=_(),[j,m]=u.useState(!1),[a,p]=u.useState(""),[c,x]=u.useState(!1),n=T(r),f=()=>{H.error("Please create an account to save projects and artists",{action:{label:"Sign up",onClick:()=>window.location.href="/auth"}})},C=e=>{if(e.stopPropagation(),!g){f();return}B.mutate(r)},k=(e,t)=>{e.stopPropagation(),N.mutate({collectionId:t,artistId:r}),m(!1)},d=e=>{e.stopPropagation(),a.trim()&&D.mutate({name:a.trim(),type:"artists"},{onSuccess:t=>{N.mutate({collectionId:t.id,artistId:r}),p(""),x(!1),m(!1)}})},v=e=>{if(!g&&e){f();return}m(e)},w=e=>{e.stopPropagation()};return I==="icon"?s.jsxs("div",{className:l("flex items-center gap-1",h),children:[s.jsx(o,{variant:"ghost",size:"icon",className:l("h-8 w-8 rounded-full bg-background/80 backdrop-blur-sm hover:bg-background",n&&"text-red-500"),onClick:C,children:s.jsx(b,{className:l("w-4 h-4",n&&"fill-current")})}),s.jsxs(y,{open:j,onOpenChange:v,children:[s.jsx(P,{asChild:!0,children:s.jsx(o,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-full bg-background/80 backdrop-blur-sm hover:bg-background",onClick:w,children:s.jsx(z,{className:"w-4 h-4"})})}),s.jsx(A,{className:"w-56 p-2",align:"end",onClick:e=>e.stopPropagation(),children:s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground px-2 py-1",children:"Add to collection"}),i.length===0&&!c?s.jsx("p",{className:"text-xs text-muted-foreground px-2 py-2",children:"No collections yet"}):i.map(e=>s.jsx(O,{name:e.name,coverImages:e.cover_images,onClick:t=>k(t,e.id)},e.id)),c?s.jsxs("div",{className:"flex gap-1 pt-1",children:[s.jsx(L,{placeholder:"Name...",value:a,onChange:e=>p(e.target.value),className:"h-8 text-sm",onClick:e=>e.stopPropagation(),onKeyDown:e=>{e.key==="Enter"&&d(e)}}),s.jsx(o,{size:"sm",className:"h-8 px-2",onClick:d,disabled:!a.trim(),children:s.jsx(S,{className:"w-4 h-4"})})]}):s.jsxs("button",{className:"w-full text-left px-2 py-1.5 text-sm rounded hover:bg-secondary transition-colors flex items-center gap-2 text-primary",onClick:e=>{e.stopPropagation(),x(!0)},children:[s.jsx(E,{className:"w-3 h-3"}),"New collection"]})]})})]})]}):s.jsxs("div",{className:l("flex items-center gap-2",h),children:[s.jsxs(o,{variant:n?"default":"outline",size:"sm",className:"gap-2",onClick:C,children:[s.jsx(b,{className:l("w-4 h-4",n&&"fill-current")}),n?"Liked":"Like"]}),s.jsxs(y,{open:j,onOpenChange:v,children:[s.jsx(P,{asChild:!0,children:s.jsxs(o,{variant:"outline",size:"sm",className:"gap-2",onClick:w,children:[s.jsx(z,{className:"w-4 h-4"}),"Save"]})}),s.jsx(A,{className:"w-56 p-2",align:"end",children:s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground px-2 py-1",children:"Add to collection"}),i.length===0&&!c?s.jsx("p",{className:"text-xs text-muted-foreground px-2 py-2",children:"No collections yet"}):i.map(e=>s.jsx(O,{name:e.name,coverImages:e.cover_images,onClick:t=>k(t,e.id)},e.id)),c?s.jsxs("div",{className:"flex gap-1 pt-1",children:[s.jsx(L,{placeholder:"Name...",value:a,onChange:e=>p(e.target.value),className:"h-8 text-sm",onKeyDown:e=>{e.key==="Enter"&&d(e)}}),s.jsx(o,{size:"sm",className:"h-8 px-2",onClick:d,disabled:!a.trim(),children:s.jsx(S,{className:"w-4 h-4"})})]}):s.jsxs("button",{className:"w-full text-left px-2 py-1.5 text-sm rounded hover:bg-secondary transition-colors flex items-center gap-2 text-primary",onClick:()=>x(!0),children:[s.jsx(E,{className:"w-3 h-3"}),"New collection"]})]})})]})]})};export{Q as A};

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.