<?php

namespace App\View\Components;

use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
use App\Models\Page;

class PageList extends Component
{
     public $pages;

    public function __construct()
    {
           $this->pages = Page::where('active', 1)->orderBy('created_at', 'desc')->get();
    }

    public function render(): View|Closure|string
    {
        return view('components.page-list');
    }
}