@php $input = 'w-full rounded-xl border border-edge bg-ink px-3.5 py-2.5 text-sm text-slate-100 placeholder:text-slate-500 focus:border-brand focus:ring-2 focus:ring-brand/30'; $lbl = 'mb-1.5 block text-sm font-medium text-slate-300'; $statusChip = ['active' => 'bg-green-500/15 text-green-400', 'suspended' => 'bg-red-500/15 text-red-400', 'pending' => 'bg-amber-500/15 text-amber-400'][$user->status] ?? 'bg-slate-500/15 text-slate-400'; $roleChip = ['super_admin' => 'bg-brand/15 text-brand-500', 'staff' => 'bg-blue-500/15 text-blue-400'][$user->role] ?? 'bg-slate-500/15 text-slate-400'; $plan = optional($user->currentSubscription)->plan; $tabs = ['overview' => 'Overview', 'account' => 'Account Information', 'subscription' => 'Subscription', 'activity' => 'Activity Log', 'connected' => 'Connected Accounts', 'permissions' => 'Permissions']; $platMeta = ['facebook' => ['Facebook', '#1877f2'], 'instagram' => ['Instagram', '#d62976'], 'tiktok' => ['TikTok', '#22d3ee'], 'youtube' => ['YouTube', '#ef4444'], 'linkedin' => ['LinkedIn', '#0a66c2'], 'threads' => ['Threads', '#a855f7']]; $row = fn ($k, $v) => '
'.$k.'
'.$v.'
'; @endphp
{{-- breadcrumb + header --}}
@unless ($user->isAdmin() || $user->id === auth()->id())
@csrf
@endunless Export User Data
{{-- ===== Banner ===== --}}
@if ($user->avatarUrl()) @else {{ strtoupper(substr($user->name ?: $user->email, 0, 1)) }} @endif

{{ $user->name }}

{{ ucfirst($user->status) }} User {{ str_replace('_', ' ', $user->role) }}
{{ $user->email }} @if ($user->phone) {{ $user->phone }}@endif @if ($user->location || $user->country) {{ $user->location ?: $user->country }}@endif
User ID: {{ $user->id }} copied
@php($bannerCards = [ ['send', '#7c3aed', 'Total Posts', number_format(optional($user->usage)->posts_month ?? 0), '↑ 18.2%'], ['calendar', '#3b82f6', 'Joined Date', $user->created_at->format('M j, Y'), $user->created_at->diffForHumans()], ['share-2', '#22c55e', 'Total Accounts', number_format($connectedTotal), 'Connected'], ['crown', '#f59e0b', 'User Plan', $plan?->name ?? 'Free', $plan ? 'Active' : '—'], ]) @foreach ($bannerCards as [$icon, $tint, $lbl2, $val, $sub])
{{ $lbl2 }}
{{ $val }}
{{ $sub }}
@endforeach
@if ($newPassword)
New password (shown once): {{ $newPassword }}
@endif {{-- ===== Body: tabs (left) + rail (right) ===== --}}
{{-- tabs --}}
@foreach ($tabs as $key => $lbl3) @endforeach
{{-- OVERVIEW --}} @if ($tab === 'overview')
{!! $row('Full Name', e($user->name)) !!} {!! $row('Username', e($user->username ?: '—')) !!} {!! $row('Email', e($user->email).' '.($user->email_verified_at ? 'Verified' : 'Pending')) !!} {!! $row('Phone', e($user->phone ?: '—')) !!} {!! $row('Country', e($user->country ?: '—')) !!} {!! $row('Timezone', e($user->timezone ?: 'UTC')) !!} {!! $row('Status', ''.ucfirst($user->status).'') !!} {!! $row('Joined', $user->created_at->format('M j, Y')) !!}
{{ $plan?->name ?? 'Free Plan' }} @if($plan)Active@endif
{{ $plan?->features ? '' : 'No active subscription' }}
Plan Price${{ number_format($plan?->price ?? 0, 2) }} / {{ ucfirst($plan?->interval ?? 'mo') }}
Started On{{ optional($user->currentSubscription)->starts_at?->format('M j, Y') ?? '—' }}
Renewal Date{{ optional($user->currentSubscription)->ends_at?->format('M j, Y') ?? '—' }}
Accounts Used{{ $connectedTotal }}
{{-- Quick actions --}}
@php($qa = [ ['pencil', 'Edit User', "\$wire.openEdit()"], ['key-round', 'Reset Password', "\$wire.resetPassword()"], ['ban', $user->isSuspended() ? 'Activate User' : 'Suspend User', "\$wire.toggleSuspend()"], ['credit-card', 'Change Plan', "\$wire.set('tab','subscription')"], ['scroll-text', 'Activity Log', "\$wire.set('tab','activity')"], ['share-2', 'Connected Accounts', "\$wire.set('tab','connected')"], ]) @foreach ($qa as [$icon, $lbl4, $act]) @endforeach
{{-- Notes --}}
@error('noteBody')

{{ $message }}

@enderror
@forelse ($notes as $note)
{{ $note->body }}
@if ($note->is_pinned)Pinned@endif @if ($note->is_private)Private@endif {{ $note->author?->name ?? 'Admin' }} · {{ $note->created_at->diffForHumans() }}
@empty
No notes yet.
@endforelse
{{-- Recent activity --}}

Recent Activity

@include('livewire.admin.users._activity-table', ['rows' => $recentActivity])
@endif {{-- ACCOUNT INFORMATION --}} @if ($tab === 'account')
{!! $row('Full Name', e($user->name)) !!} {!! $row('Username', e($user->username ?: '—')) !!} {!! $row('Email Address', e($user->email)) !!} {!! $row('Phone Number', e($user->phone ?: '—')) !!} {!! $row('Date of Birth', $user->date_of_birth?->format('M j, Y') ?? '—') !!} {!! $row('Gender', e($user->gender ?: '—')) !!} {!! $row('Language', e(optional($user->preferences)->language ?: 'en')) !!} {!! $row('Timezone', e($user->timezone ?: 'UTC')) !!} {!! $row('Country', e($user->country ?: '—')) !!} {!! $row('Status', ''.ucfirst($user->status).'') !!} {!! $row('Email Verified', $user->email_verified_at ? 'Yes' : 'No') !!} {!! $row('Registration Date', $user->created_at->format('M j, Y')) !!} {!! $row('Last Login', $user->last_login_at?->diffForHumans() ?? 'Never') !!} {!! $row('Referral Code', e($user->referral_code ?: '—')) !!} {!! $row('Referral Source', e($user->referral_source ?: '—')) !!}
@endif {{-- SUBSCRIPTION --}} @if ($tab === 'subscription')

Subscriptions & Renewal History

@error('assignPlanId')
{{ $message }}
@enderror
@forelse ($subscriptions as $sub) @empty @endforelse
PlanPriceStatusStartedEndsAction
{{ $sub->plan?->name ?? '—' }} ${{ number_format($sub->plan?->price ?? 0, 2) }} {{ $sub->status }} {{ $sub->starts_at?->format('M j, Y') ?? '—' }} {{ $sub->ends_at?->format('M j, Y') ?? '—' }} @if ($sub->status === 'active')@endif
No subscription history.
@foreach (['posts_per_day' => 'Daily Posts', 'posts_per_month' => 'Monthly Posts', 'max_scheduled' => 'Scheduled', 'queue_size' => 'Queue'] as $k => $label)
{{ $label }}
{{ $usage['quotas'][$k]['used'] }} / {{ is_null($usage['quotas'][$k]['limit']) ? '∞' : $usage['quotas'][$k]['limit'] }}
@endforeach
@endif {{-- ACTIVITY LOG --}} @if ($tab === 'activity') @include('livewire.admin.users._activity-table', ['rows' => $activity])
{{ $activity->links('pagination.dark') }}
@endif {{-- CONNECTED ACCOUNTS --}} @if ($tab === 'connected') @if ($connectedTotal === 0)
No connected accounts reported.
@else
@foreach ($accountsUsage as $platform => $count) @php([$plabel, $pcolor] = $platMeta[$platform] ?? [ucfirst($platform), '#64748b']) @if ($count > 0)
{{ strtoupper(substr($plabel, 0, 2)) }}
{{ $plabel }}
{{ $count }} account(s) connected
Reported
@endif @endforeach

Per-account details (avatar, last sync, posts) live in the user's desktop app; the server sees aggregate counts.

@endif
@endif {{-- PERMISSIONS --}} @if ($tab === 'permissions')
{!! $row('Current Role', ''.str_replace('_',' ',$user->role).'') !!} {!! $row('Admin Access', $user->isAdmin() ? 'Yes' : 'No') !!} {!! $row('Desktop Access', $user->isActive() ? 'Yes' : 'Suspended') !!} {!! $row('API Access', $security['tokens'].' token(s)') !!}
Assigned Permissions
@php($perms = is_array($user->permissions) ? $user->permissions : []) @if (count($perms))
@foreach ($perms as $p){{ $p }}@endforeach
@else

{{ $user->isSuperAdmin() ? 'Super admin — full unrestricted access.' : 'No granular permissions (standard customer access).' }}

@endif
@endif
{{-- ===== Right rail ===== --}}
{{-- Activity summary chart --}}

User Activity Summary

Posts Published{{ number_format(optional($user->usage)->posts_month ?? 0) }}
Posts Scheduled{{ number_format(optional($user->usage)->scheduled ?? 0) }}
In Queue{{ number_format(optional($user->usage)->queue ?? 0) }}
{{-- Storage (illustrative) --}}
62%
6.2 GB / 10 GB
Videos: 892
Images: 353
Files: 1,245

Storage figures are illustrative until the desktop reports per-user usage.

{{-- Tags --}}
@forelse ($tags as $t) {{ $t }} @empty No tags yet. @endforelse
@foreach (\App\Livewire\Admin\Users\Show::TAG_PRESETS as $preset) @unless (in_array($preset, $tags)) @endunless @endforeach
{{-- Security --}}
Two-Factor{{ $security['two_factor'] ? 'Enabled' : 'Disabled' }}
Password Changed{{ $security['password_changed']?->format('M j, Y') ?? 'Never' }}
Active Sessions{{ $security['sessions'] }}
API Tokens{{ $security['tokens'] }}
Security Score{{ $security['score'] }}%
{{-- ===== Edit modal ===== --}} @if ($showEdit)

Edit User

@error('name')

{{ $message }}

@enderror
@error('username')

{{ $message }}

@enderror
@error('email')

{{ $message }}

@enderror
@endif @script @endscript