Some checks failed
CI / build-and-test (pull_request) Has been cancelled
### 1. __artists-grid.tsx__ (Main Artist Browsing)
- Uses hook from
- Fetches from endpoint
- Includes loading states, error handling, and filtering
- __Impact:__ Primary artist browsing experience now fully API-driven
### 2. __artist-portfolio.tsx__ (Individual Artist Pages)
- Uses hook
- Fetches from endpoint
- Fixed all TypeScript errors (changed image ID from number to string)
- Added loading/error states
- __Impact:__ Artist detail pages now fully API-driven
### 3. __booking-form.tsx__ (Artist Selection Dropdown)
- Uses hook for artist selection
- Updated to use API data structure ( array, , etc.)
- Added loading state for dropdown
- __Impact:__ Booking flow now uses real artist data
## ⚠️ REMAINING (Decorative/Marketing Components)
Two complex components still use hardcoded :
### 4. __artists-section.tsx__ (Homepage Hero - 348 lines)
- Homepage marketing section with complex parallax scrolling
- Uses hardcoded artist data for visual cards
- __Non-blocking:__ This is a decorative homepage element
### 5. __artists-page-section.tsx__ (Artists Page Section - 413 lines)
- Full-page artists showcase with parallax effects
- Uses hardcoded artist data for visual layout
- __Non-blocking:__ Alternative to artists-grid.tsx (which IS using API)
##
1 line
8.6 KiB
JavaScript
1 line
8.6 KiB
JavaScript
exports.id=5593,exports.ids=[5593],exports.modules={61816:(e,r,s)=>{Promise.resolve().then(s.bind(s,29343))},29343:(e,r,s)=>{"use strict";s.d(r,{AdminSidebar:()=>_});var n,i,t=s(97247),a=s(79906),l=s(34178),o=s(19898),c=s(56460),d=s(57989),m=s(72465),u=s(50820),N=s(35216),E=s(69964),x=s(17316),h=s(19400),I=s(58053),f=s(25008);(function(e){e.SUPER_ADMIN="SUPER_ADMIN",e.SHOP_ADMIN="SHOP_ADMIN",e.ARTIST="ARTIST",e.CLIENT="CLIENT"})(n||(n={})),function(e){e.PENDING="PENDING",e.CONFIRMED="CONFIRMED",e.IN_PROGRESS="IN_PROGRESS",e.COMPLETED="COMPLETED",e.CANCELLED="CANCELLED"}(i||(i={}));let g=[{name:"Dashboard",href:"/admin",icon:c.Z,roles:[n.SHOP_ADMIN,n.SUPER_ADMIN]},{name:"Artists",href:"/admin/artists",icon:d.Z,roles:[n.SHOP_ADMIN,n.SUPER_ADMIN]},{name:"Portfolio",href:"/admin/portfolio",icon:m.Z,roles:[n.SHOP_ADMIN,n.SUPER_ADMIN]},{name:"Calendar",href:"/admin/calendar",icon:u.Z,roles:[n.SHOP_ADMIN,n.SUPER_ADMIN]},{name:"Analytics",href:"/admin/analytics",icon:N.Z,roles:[n.SHOP_ADMIN,n.SUPER_ADMIN]},{name:"File Manager",href:"/admin/uploads",icon:E.Z,roles:[n.SHOP_ADMIN,n.SUPER_ADMIN]},{name:"Settings",href:"/admin/settings",icon:x.Z,roles:[n.SHOP_ADMIN,n.SUPER_ADMIN]}];function _({user:e}){let r=(0,l.usePathname)(),s=g.filter(r=>r.roles.includes(e.role)),n=async()=>{await (0,o.signOut)({callbackUrl:"/"})};return(0,t.jsxs)("div",{className:"flex flex-col w-64 bg-white shadow-lg",children:[t.jsx("div",{className:"flex items-center justify-center h-16 px-4 border-b border-gray-200",children:(0,t.jsxs)(a.default,{href:"/",className:"flex items-center space-x-2",children:[t.jsx("div",{className:"w-8 h-8 bg-black rounded-md flex items-center justify-center",children:t.jsx("span",{className:"text-white font-bold text-sm",children:"U"})}),t.jsx("span",{className:"text-xl font-bold text-gray-900",children:"United Admin"})]})}),t.jsx("nav",{className:"flex-1 px-4 py-6 space-y-2",children:s.map(e=>{let s=r===e.href,n=e.icon;return(0,t.jsxs)(a.default,{href:e.href,className:(0,f.cn)("flex items-center px-3 py-2 text-sm font-medium rounded-md transition-colors",s?"bg-gray-100 text-gray-900":"text-gray-600 hover:bg-gray-50 hover:text-gray-900"),children:[t.jsx(n,{className:"w-5 h-5 mr-3"}),e.name]},e.name)})}),(0,t.jsxs)("div",{className:"border-t border-gray-200 p-4",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-3 mb-4",children:[t.jsx("div",{className:"w-10 h-10 bg-gray-300 rounded-full flex items-center justify-center",children:e.image?t.jsx("img",{src:e.image,alt:e.name,className:"w-10 h-10 rounded-full"}):t.jsx("span",{className:"text-sm font-medium text-gray-600",children:e.name.charAt(0).toUpperCase()})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium text-gray-900 truncate",children:e.name}),t.jsx("p",{className:"text-xs text-gray-500 truncate",children:e.role.replace("_"," ").toLowerCase()})]})]}),(0,t.jsxs)(I.z,{variant:"outline",size:"sm",onClick:n,className:"w-full justify-start",children:[t.jsx(h.Z,{className:"w-4 h-4 mr-2"}),"Sign Out"]})]})]})}},49446:(e,r,s)=>{"use strict";s.r(r),s.d(r,{default:()=>d});var n=s(72051),i=s(41288),t=s(4128),a=s(33897),l=s(74725);let o=(0,s(45347).createProxy)(String.raw`/home/Nicholai/Documents/Dev/united_v03/united-tattoo/united-tattoo/components/admin/sidebar.tsx#AdminSidebar`);var c=s(93470);async function d({children:e}){if(!c.vU.ADMIN_ENABLED)return n.jsx("div",{className:"min-h-screen flex items-center justify-center p-8",children:(0,n.jsxs)("div",{className:"max-w-md text-center space-y-4",children:[n.jsx("h1",{className:"text-2xl font-semibold",children:"Admin temporarily unavailable"}),n.jsx("p",{className:"text-muted-foreground",children:"We’re performing maintenance or addressing an incident. Please try again later."})]})});let r=await (0,t.getServerSession)(a.Lz);return r||(0,i.redirect)("/auth/signin"),r.user.role!==l.i.SHOP_ADMIN&&r.user.role!==l.i.SUPER_ADMIN&&(0,i.redirect)("/unauthorized"),(0,n.jsxs)("div",{className:"flex h-screen bg-gray-100",children:[n.jsx(o,{user:r.user}),(0,n.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden",children:[n.jsx("header",{className:"bg-white shadow-sm border-b border-gray-200",children:(0,n.jsxs)("div",{className:"flex items-center justify-between px-6 py-4",children:[n.jsx("h1",{className:"text-2xl font-semibold text-gray-900",children:"Admin Dashboard"}),(0,n.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,n.jsxs)("span",{className:"text-sm text-gray-600",children:["Welcome, ",r.user.name]}),n.jsx("div",{className:"w-8 h-8 bg-gray-300 rounded-full flex items-center justify-center",children:r.user.image?n.jsx("img",{src:r.user.image,alt:r.user.name,className:"w-8 h-8 rounded-full"}):n.jsx("span",{className:"text-sm font-medium text-gray-600",children:r.user.name.charAt(0).toUpperCase()})})]})]})}),n.jsx("main",{className:"flex-1 overflow-y-auto p-6",children:e})]})]})}},33897:(e,r,s)=>{"use strict";s.d(r,{Lz:()=>d,KR:()=>E,Z1:()=>m,GJ:()=>N,KN:()=>x,mk:()=>u});var n=s(22571),i=s(43016),t=s(76214),a=s(29628);let l=a.z.object({DATABASE_URL:a.z.string().url(),DIRECT_URL:a.z.string().url().optional(),NEXTAUTH_URL:a.z.string().url(),NEXTAUTH_SECRET:a.z.string().min(1),GOOGLE_CLIENT_ID:a.z.string().optional(),GOOGLE_CLIENT_SECRET:a.z.string().optional(),GITHUB_CLIENT_ID:a.z.string().optional(),GITHUB_CLIENT_SECRET:a.z.string().optional(),AWS_ACCESS_KEY_ID:a.z.string().min(1),AWS_SECRET_ACCESS_KEY:a.z.string().min(1),AWS_REGION:a.z.string().min(1),AWS_BUCKET_NAME:a.z.string().min(1),AWS_ENDPOINT_URL:a.z.string().url().optional(),NODE_ENV:a.z.enum(["development","production","test"]).default("development"),SMTP_HOST:a.z.string().optional(),SMTP_PORT:a.z.string().optional(),SMTP_USER:a.z.string().optional(),SMTP_PASSWORD:a.z.string().optional(),VERCEL_ANALYTICS_ID:a.z.string().optional()}),o=function(){try{return l.parse(process.env)}catch(e){if(e instanceof a.z.ZodError){let r=e.errors.map(e=>e.path.join(".")).join(", ");throw Error(`Missing or invalid environment variables: ${r}`)}throw e}}();var c=s(74725);let d={providers:[(0,t.Z)({name:"credentials",credentials:{email:{label:"Email",type:"email"},password:{label:"Password",type:"password"}},async authorize(e){if(console.log("Authorize called with:",e),!e?.email||!e?.password)return console.log("Missing email or password"),null;if(console.log("Email received:",e.email),console.log("Password received:",e.password?"***":"empty"),"nicholai@biohazardvfx.com"===e.email)return console.log("Admin user recognized!"),{id:"admin-nicholai",email:"nicholai@biohazardvfx.com",name:"Nicholai",role:c.i.SUPER_ADMIN};console.log("Using fallback user creation");let r={id:"dev-user-"+Date.now(),email:e.email,name:e.email.split("@")[0],role:c.i.SUPER_ADMIN};return console.log("Created user:",r),r}}),...o.GOOGLE_CLIENT_ID&&o.GOOGLE_CLIENT_SECRET?[(0,n.Z)({clientId:o.GOOGLE_CLIENT_ID,clientSecret:o.GOOGLE_CLIENT_SECRET})]:[],...o.GITHUB_CLIENT_ID&&o.GITHUB_CLIENT_SECRET?[(0,i.Z)({clientId:o.GITHUB_CLIENT_ID,clientSecret:o.GITHUB_CLIENT_SECRET})]:[]],session:{strategy:"jwt",maxAge:2592e3},callbacks:{jwt:async({token:e,user:r,account:s})=>(r&&(e.role=r.role||c.i.CLIENT,e.userId=r.id),e),session:async({session:e,token:r})=>(r&&(e.user.id=r.userId,e.user.role=r.role),e),signIn:async({user:e,account:r,profile:s})=>!0,redirect:async({url:e,baseUrl:r})=>e.startsWith("/")?`${r}${e}`:new URL(e).origin===r?e:`${r}/admin`},pages:{signIn:"/auth/signin",error:"/auth/error"},events:{async signIn({user:e,account:r,profile:s,isNewUser:n}){console.log(`User ${e.email} signed in`)},async signOut({session:e,token:r}){console.log("User signed out")}},debug:"development"===o.NODE_ENV};async function m(){let{getServerSession:e}=await s.e(4128).then(s.bind(s,4128));return e(d)}async function u(e){let r=await m();if(!r)throw Error("Authentication required");if(e&&!function(e,r){let s={[c.i.CLIENT]:0,[c.i.ARTIST]:1,[c.i.SHOP_ADMIN]:2,[c.i.SUPER_ADMIN]:3};return s[e]>=s[r]}(r.user.role,e))throw Error("Insufficient permissions");return r}function N(e){return e===c.i.SHOP_ADMIN||e===c.i.SUPER_ADMIN}async function E(){let e=await m();if(!e?.user)return null;let r=e.user.role;if(r!==c.i.ARTIST&&!N(r))return null;let{getArtistByUserId:n}=await s.e(1035).then(s.bind(s,1035)),i=await n(e.user.id);return i?{artist:i,user:e.user}:null}async function x(){let e=await E();if(!e)throw Error("Artist authentication required");return e}},74725:(e,r,s)=>{"use strict";var n,i;s.d(r,{Z:()=>i,i:()=>n}),function(e){e.SUPER_ADMIN="SUPER_ADMIN",e.SHOP_ADMIN="SHOP_ADMIN",e.ARTIST="ARTIST",e.CLIENT="CLIENT"}(n||(n={})),function(e){e.PENDING="PENDING",e.CONFIRMED="CONFIRMED",e.IN_PROGRESS="IN_PROGRESS",e.COMPLETED="COMPLETED",e.CANCELLED="CANCELLED"}(i||(i={}))}}; |