<?php

namespace App\Filament\Resources\SalesOrderResource\Pages;

use App\Filament\Resources\Concerns\HasKpiHeader;
use App\Filament\Resources\Concerns\HasStatusTabs;
use App\Filament\Resources\SalesOrderResource;
use App\Filament\Widgets\SalesOrderTotalsOverview;
use App\Models\Lookups\Status;
use Filament\Actions\CreateAction;
use Filament\Resources\Pages\ListRecords;
use Filament\Support\Enums\Width;

class ListSalesOrders extends ListRecords
{
    use HasKpiHeader;
    use HasStatusTabs;

    protected static string $resource = SalesOrderResource::class;

    protected static string $tabStatusContext = Status::CTX_SALES_ORDER;

    protected static string $kpiWidget = SalesOrderTotalsOverview::class;

    protected Width|string|null $maxContentWidth = Width::Full;

    protected function getHeaderActions(): array
    {
        return [
            CreateAction::make()->label('New sales order'),
        ];
    }
}