<?php

namespace App\Mail;

use App\Models\ContentSync;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;

class ContentSyncApprovalActionedMail extends Mailable
{
    use Queueable;
    use SerializesModels;

    public function __construct(public readonly ContentSync $contentSync)
    {
    }

    public function build(): self
    {
        $status = $this->contentSync->isApproved() ? 'Approved' : 'Rejected';

        return $this
            ->subject("Content Sync Request {$status}")
            ->view('emails.content-sync-approval-actioned', [
                'contentSync' => $this->contentSync,
                'status' => $status,
                'colours' => [
                    'app-text-colour' => '#000000',
                    'app-primary-colour' => '#3C576B',
                ],
            ]);
    }
}
