@php /* ── Platform helpers ───────────────────────────────────────────────────── */ $platformColors = [ 'twitter' => '#000000', 'facebook' => '#1877f2', 'instagram' => '#e1306c', 'linkedin' => '#0a66c2', 'tiktok' => '#000000', 'youtube' => '#ff0000', 'pinterest' => '#e60023', 'threads' => '#000000', ]; /* Platform SVG icon paths (stroke-based, 24×24 viewBox) */ $platformIcons = [ 'twitter' => '', 'facebook' => '', 'instagram' => '', 'linkedin' => '', 'tiktok' => '', 'youtube' => '', 'pinterest' => '', ]; $pct = $charLimit > 0 ? min(100, round($charCount / $charLimit * 100)) : 0; $charOverLimit = $charCount > $charLimit; $charWarning = $charCount > $charLimit * 0.9; @endphp {{-- ═══════════════════════════ COMPOSER SHELL ═══════════════════════════ --}}
{{-- ══════════════ LEFT COLUMN — COMPOSER FORM ══════════════ --}}
{{-- ── Tab Bar ─────────────────────────────────────────────────────── --}} {{-- ── 1. Select Accounts ───────────────────────────────────────────── --}}
{{-- Trigger button --}} {{-- Dropdown --}}
@if(empty($connectedAccounts)) @else {{-- Header row --}}
YOUR ACCOUNTS
@foreach($connectedAccounts as $account) @php $isSel = in_array($account['id'], $selectedAccountIds); $pColor = $platformColors[$account['platform']] ?? '#6b7280'; $pIcon = $platformIcons[$account['platform']] ?? ''; @endphp
{{-- Platform icon circle --}}
{!! $pIcon !!}
{{-- Names --}}
{{ ucfirst($account['platform']) }}
{{ $account['name'] }}
{{-- Checkbox --}}
@if($isSel) @endif
@endforeach @endif
{{-- ── 2. Caption Textarea ──────────────────────────────────────────── --}}
{{-- Char counter --}}
@if(!empty($hashtags))
@foreach($hashtags as $tag) {{ $tag }} @endforeach
@endif {{ $charCount }} / {{ number_format($charLimit) }}
{{-- ── 3. Toolbar ──────────────────────────────────────────────────── --}}
{{-- Add Media button --}} {{-- Divider --}}
{{-- URL input --}}
@if($linkUrl) @endif
{{-- Divider --}}
{{-- Emoji picker --}}
EMOJI
@foreach(['😀','😂','🥰','😍','🤩','😎','🤔','😊','🎉','🔥','💯','❤️','✨','💪','🙌','👏','🎯','💡','📌','🚀','⭐','🌟','💫','🎊','🎁','🌈','💰','📈','🤝','✅','⚠️','📱','💻','🌍','🎵','🍕','☕','🌺','🐶','🔗','📧','📞','🏆','🥇','👑','💎','🛒','📦'] as $emoji) @endforeach
{{-- Hashtag toggle --}} {{-- AI Assist --}}
{{-- ── Hashtag Panel ────────────────────────────────────────────────── --}} @if($showHashtagPanel)
# Hashtag Manager
#
@php $hashtagGroups2 = $hashtagGroups ?? collect([]); @endphp @if($hashtagGroups2->isNotEmpty())
SAVED GROUPS
@foreach($hashtagGroups2 as $group) @endforeach
@endif
@endif {{-- ── AI Content Panel ─────────────────────────────────────────────── --}} @if($showAIPanel)
AI Caption Generator
@if(!empty($aiVariations))
@foreach($aiVariations as $i => $variation)
OPTION {{ $i + 1 }}

{{ $variation }}

@endforeach
@endif
@endif {{-- ── 4. Media Preview Grid ────────────────────────────────────────── --}}
{{-- ── 5. Link Preview Card ─────────────────────────────────────────── --}} @if(!empty($linkPreview))
@if(!empty($linkPreview['image'])) @endif
{{ $linkPreview['title'] ?? '' }}
{{ $linkPreview['site'] ?? '' }}
@if(!empty($linkPreview['description']))
{{ $linkPreview['description'] }}
@endif
@endif {{-- ── 6. Post Timing ───────────────────────────────────────────────── --}}
When to post
{{-- Post now --}} {{-- Schedule --}} {{-- Save as draft --}}
{{-- ── 7. Action Bar ────────────────────────────────────────────────── --}}
{{-- Trash --}} {{-- Right buttons --}}
{{-- Save as Draft --}} {{-- Smart Schedule (decorative) --}} {{-- Primary action --}} @if($postMode === 'schedule') @elseif($postMode === 'draft') @else @endif
{{-- /max-width wrapper --}}
{{-- /left column --}} {{-- ══════════════ RIGHT COLUMN — POST PREVIEW ══════════════ --}}
{{-- Header --}}
Post preview
See how your post will look
@if(empty($selectedAccountIds)) {{-- No accounts selected --}}

Select accounts first

Choose platforms to preview how your post will look

@else {{-- Platform tabs (one per selected account) --}}
@foreach($selectedAccounts as $sa) @php $isActivePrev = $activePreview === $sa['platform']; $pColor2 = $platformColors[$sa['platform']] ?? '#6b7280'; $pIcon2 = $platformIcons[$sa['platform']] ?? ''; @endphp @endforeach
{{-- Preview card --}} @php $activeSa = collect($selectedAccounts)->firstWhere('platform', $activePreview) ?? $selectedAccounts[0]; $cardColor = $platformColors[$activeSa['platform']] ?? '#6b7280'; $cardIcon = $platformIcons[$activeSa['platform']] ?? ''; $userName = Auth::user()->name ?? 'Your Name'; $userHandle = '@' . \Illuminate\Support\Str::slug($userName, ''); @endphp
{{-- Platform header bar --}}
{!! $cardIcon !!}
{{ ucfirst($activeSa['platform']) }}
{{-- Post body --}}
{{-- Avatar --}}
{{ strtoupper(substr($userName, 0, 1)) }}
{{-- Name + handle --}}
{{ $userName }}
{{ $userHandle }}
{{-- Caption with hashtags highlighted --}}

@if($caption) @php $displayCaption = preg_replace('/(#\w+)/u', '$1', e($caption)); @endphp {!! $displayCaption !!} @else Your caption will appear here… @endif

{{-- Media preview (JS-populated) --}}
{{-- Link preview --}} @if(!empty($linkPreview))
@if(!empty($linkPreview['image'])) @endif
{{ $linkPreview['title'] ?? '' }}
{{ $linkPreview['site'] ?? '' }}
@endif {{-- Timestamp --}}
@if($postMode === 'schedule' && $scheduledDate && $scheduledTime) Scheduled: {{ \Carbon\Carbon::parse($scheduledDate . ' ' . $scheduledTime)->format('M j, Y g:i A') }} @else {{ now()->format('M j, Y g:i A') }} @endif
{{-- Engagement row --}}
0 0 0
{{-- Character bar --}}
Character limit {{ number_format($charCount) }} / {{ number_format($charLimit) }}
@if($charOverLimit)

{{ abs($charLimit - $charCount) }} characters over the limit

@endif
{{-- Platform tip --}}
💡 {{ ucfirst($activeSa['platform']) }} Tips
@switch($activeSa['platform']) @case('twitter') Keep under 280 chars. Images get 150% more retweets. @break @case('instagram') 5–10 hashtags performs best. Reels get 3× more reach. @break @case('linkedin') Professional tone gets 2× more comments. @break @case('facebook') Posts at 1–4 PM get highest engagement. @break @case('tiktok') Hook viewers in the first 3 seconds. @break @default Post consistently at peak hours for your audience. @endswitch
@endif {{-- end if selectedAccountIds --}}
{{-- /preview body --}}
{{-- /right column --}}
{{-- /composer shell --}} {{-- ══════════════ MEDIA UPLOAD JS ══════════════ --}}