import{c as e,n as t,r as n,t as r}from"./app-C2kGDHB9.js";import{t as i}from"./AuthenticatedLayout-C8h2HS7D.js";e();var a=r();function o({label:e,children:t}){return(0,a.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-start gap-1 sm:gap-0 py-3.5 border-b border-gray-50 last:border-0`,children:[(0,a.jsx)(`dt`,{className:`text-xs font-semibold text-gray-500 sm:w-44 shrink-0 mt-0.5`,children:e}),(0,a.jsx)(`dd`,{className:`text-sm font-semibold text-[#3D4E4B] tracking-tight`,children:t})]})}function s({viewUser:e}){let r=`${e.first_name?.charAt(0)||``}${e.last_name?.charAt(0)||``}`.toUpperCase();return(0,a.jsxs)(i,{children:[(0,a.jsx)(t,{title:`${e.first_name} ${e.last_name} — Users`}),(0,a.jsxs)(`div`,{className:`flex items-center gap-2 text-sm mb-6 anim-fade`,children:[(0,a.jsx)(n,{href:`/users`,className:`text-gray-400 hover:text-[#3D4E4B] transition-colors font-semibold`,children:`Users`}),(0,a.jsx)(`svg`,{className:`w-3.5 h-3.5 text-gray-300`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,a.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 5l7 7-7 7`})}),(0,a.jsxs)(`span`,{className:`text-[#3D4E4B] font-bold`,children:[e.first_name,` `,e.last_name]})]}),(0,a.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-6`,children:[(0,a.jsxs)(`div`,{className:`lg:col-span-1 space-y-4 anim-up`,children:[(0,a.jsx)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm p-6`,children:(0,a.jsxs)(`div`,{className:`flex flex-col items-center text-center`,children:[(0,a.jsx)(`div`,{className:`w-20 h-20 rounded-2xl bg-[#3D4E4B] flex items-center justify-center text-white text-2xl font-bold overflow-hidden mb-4`,children:e.avatar_url?(0,a.jsx)(`img`,{src:e.avatar_url,className:`w-full h-full object-cover`,alt:``}):r}),(0,a.jsxs)(`h2`,{className:`text-base font-bold text-[#3D4E4B] tracking-tight`,children:[e.first_name,` `,e.last_name]}),(0,a.jsx)(`p`,{className:`text-xs text-gray-400 font-medium mt-0.5`,children:e.email}),(0,a.jsx)(`div`,{className:`flex flex-wrap justify-center gap-1.5 mt-3`,children:e.roles?.map(e=>(0,a.jsx)(`span`,{className:`px-2.5 py-1 text-xs font-bold bg-white text-gray-500 border border-gray-100 rounded-md`,children:e.name||e},e.name||e))}),(0,a.jsx)(`div`,{className:`mt-4`,children:(0,a.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-bold border ${e.status===`active`?`text-green-600 bg-white border-green-100`:`text-gray-400 bg-white border-gray-100`}`,children:[(0,a.jsx)(`span`,{className:`w-1 h-1 rounded-full ${e.status===`active`?`bg-green-500`:`bg-gray-300`}`}),e.status===`active`?`Active`:`Inactive`]})})]})}),(0,a.jsx)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm p-4 space-y-1`,children:(0,a.jsxs)(n,{href:`/users`,className:`flex items-center gap-3 px-3 py-2.5 rounded-xl text-sm font-semibold text-gray-500 hover:bg-gray-50 hover:text-[#3D4E4B] transition-colors w-full`,children:[(0,a.jsx)(`svg`,{className:`w-4 h-4 text-gray-400`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,a.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M10 19l-7-7m0 0l7-7m-7 7h18`})}),`Back to Users`]})})]}),(0,a.jsxs)(`div`,{className:`lg:col-span-2 space-y-4 anim-up`,style:{animationDelay:`0.08s`},children:[(0,a.jsxs)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden`,children:[(0,a.jsx)(`div`,{className:`px-6 py-4 border-b border-gray-50 bg-gray-50/30`,children:(0,a.jsx)(`h3`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight`,children:`Personal Information`})}),(0,a.jsx)(`div`,{className:`px-6`,children:(0,a.jsxs)(`dl`,{children:[(0,a.jsx)(o,{label:`First name`,children:e.first_name}),(0,a.jsx)(o,{label:`Last name`,children:e.last_name}),(0,a.jsx)(o,{label:`Email`,children:e.email}),(0,a.jsx)(o,{label:`User ID`,children:(0,a.jsxs)(`span`,{className:`font-mono text-gray-400 text-xs`,children:[`#`,e.id]})})]})})]}),(0,a.jsxs)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden`,children:[(0,a.jsx)(`div`,{className:`px-6 py-4 border-b border-gray-50 bg-gray-50/30`,children:(0,a.jsx)(`h3`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight`,children:`Roles & Permissions`})}),(0,a.jsxs)(`div`,{className:`p-6 space-y-5`,children:[(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`p`,{className:`text-xs font-semibold text-gray-400 tracking-tight mb-2`,children:`Assigned Roles`}),(0,a.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.roles?.length?e.roles.map(e=>(0,a.jsx)(`span`,{className:`px-3 py-1.5 text-xs font-bold bg-[#3D4E4B] text-white rounded-lg`,children:e.name||e},e.name||e)):(0,a.jsx)(`span`,{className:`text-sm text-gray-400 font-semibold`,children:`No roles assigned`})})]}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`p`,{className:`text-xs font-semibold text-gray-400 tracking-tight mb-2`,children:`Granted Permissions`}),(0,a.jsx)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 gap-1.5`,children:e.permissions?.length?e.permissions.map(e=>(0,a.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-gray-600 font-semibold bg-gray-50 border border-gray-100 px-2.5 py-1.5 rounded-lg`,children:[(0,a.jsx)(`div`,{className:`w-1.5 h-1.5 rounded-full bg-[#21A59F] shrink-0`}),e.name||e]},e.name||e)):(0,a.jsx)(`span`,{className:`text-sm text-gray-400 font-semibold col-span-full`,children:`Inherited from roles`})})]})]})]}),(0,a.jsxs)(`div`,{className:`bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden`,children:[(0,a.jsx)(`div`,{className:`px-6 py-4 border-b border-gray-50 bg-gray-50/30`,children:(0,a.jsx)(`h3`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight`,children:`Activity Timeline`})}),(0,a.jsxs)(`div`,{className:`p-6 space-y-4`,children:[(0,a.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,a.jsx)(`div`,{className:`w-8 h-8 rounded-xl bg-[#E3EBE8] flex items-center justify-center shrink-0`,children:(0,a.jsx)(`svg`,{className:`w-4 h-4 text-[#3D4E4B]`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,a.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 4v16m8-8H4`})})}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`p`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight`,children:`Account Created`}),(0,a.jsx)(`p`,{className:`text-xs text-gray-400 font-medium mt-0.5`,children:new Date(e.created_at).toLocaleDateString(`en-US`,{weekday:`long`,year:`numeric`,month:`long`,day:`numeric`})})]})]}),(0,a.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,a.jsx)(`div`,{className:`w-8 h-8 rounded-xl bg-[#E3EBE8] flex items-center justify-center shrink-0`,children:(0,a.jsx)(`svg`,{className:`w-4 h-4 text-[#3D4E4B]`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,a.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15`})})}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`p`,{className:`text-sm font-bold text-[#3D4E4B] tracking-tight`,children:`Last Updated`}),(0,a.jsx)(`p`,{className:`text-xs text-gray-400 font-medium mt-0.5`,children:new Date(e.updated_at).toLocaleDateString(`en-US`,{weekday:`long`,year:`numeric`,month:`long`,day:`numeric`})})]})]})]})]})]})]})]})}export{s as default};