<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class SocialPost extends Model
{
    protected $fillable = [
        'platform',
        'url',
        'title',
        'description',
        'thumbnail_url',
        'embed_html',
        'author_name',
        'status',
    ];

    public function getPlatformIconAttribute(): string
    {
        return match($this->platform) {
            'youtube'   => 'fa-brands fa-youtube text-red-600',
            'instagram' => 'fa-brands fa-instagram text-pink-500',
            'facebook'  => 'fa-brands fa-facebook text-blue-600',
            default     => 'fa-solid fa-share-nodes text-gray-400',
        };
    }
}
