<?php

namespace App\Mail;

use App\Models\Video;
use App\Models\User;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;

class NewVideoNotification extends Mailable
{
    use Queueable, SerializesModels;

    public function __construct(public Video $video, public User $uploader)
    {
    }

    public function envelope(): Envelope
    {
        return new Envelope(
            subject: $this->uploader->name . ' just uploaded a new video on ' . config('app.name'),
        );
    }

    public function content(): Content
    {
        return new Content(
            view: 'emails.new-video-notification',
        );
    }
}
