<?php

namespace App\Filament\Resources\StoreGroupResource\Pages;

use App\Filament\Resources\StoreGroupResource;
use Filament\Actions;
use Filament\Resources\Pages\ListRecords;
use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Support\HtmlString;

class ListStoreGroups extends ListRecords
{
    protected static string $resource = StoreGroupResource::class;

    public function getHeading(): string | Htmlable
    {
        $icon = static::$resource::getNavigationIcon();

        if (blank($icon)) {
            return parent::getHeading();
        }

        return new HtmlString(
            view('filament.module-heading', [
                'icon' => $icon,
                'heading' => parent::getHeading(),
            ])->render(),
        );
    }

    public function getSubheading(): ?string
    {
        return static::$resource::getModuleDescription();
    }

    protected function getHeaderActions(): array
    {
        return [
            Actions\CreateAction::make() ->icon('heroicon-m-plus'),
        ];
    }
}
