<?php

declare(strict_types=1);

namespace App\Filament\Components\Form;

use App\Filament\Support\SelectOptionLabels;

use Filament\Forms\Components\Select;

class ProductSelect extends Select
{
    public static function create(): static
    {
        return parent::make('product_id')
            ->label('محصول')
            ->relationship('product', 'name')
            ->getOptionLabelFromRecordUsing(fn ($record) => SelectOptionLabels::product($record))
            ->searchable()
            ->preload()
            ->columnSpan(6);
    }
}
