<?php

declare(strict_types=1);

namespace App\Filament\Components\Form;

use App\Filament\Support\SelectOptionLabels;

use Filament\Forms\Components\Select;

class ProducerSelect extends Select
{
    public static function create(): static
    {
        return parent::make('producer_id')
            ->label('تولیدکننده')
            ->relationship('producer', 'brand_name')
            ->getOptionLabelFromRecordUsing(fn ($record) => SelectOptionLabels::producer($record))
            ->searchable(['brand_name'])
            ->preload()
            ->columnSpan(6);
    }
}

