<?php

declare(strict_types=1);

namespace App\Filament\Components\Form;

use App\Filament\Support\SelectOptionLabels;

use Filament\Forms\Components\Select;

class CategorySelect extends Select
{
    public static function create(): static
    {
        return parent::make('category_id')
            ->label('دسته')
            ->relationship('category', 'title')
            ->getOptionLabelFromRecordUsing(fn ($record) => SelectOptionLabels::category($record))
            ->searchable()
            ->preload()
            ->columnSpan(6);
    }
}
