<?php

declare(strict_types=1);

namespace App\Filament\Components\Form;

use App\Filament\Support\SelectOptionLabels;

use Filament\Forms\Components\Select;

class BidSelect extends Select
{
    public static function create(): static
    {
        return parent::make('bid_id')
            ->label('پیشنهاد')
            ->label('منبع اختلاف')
            ->relationship('bid', 'title')
            ->getOptionLabelFromRecordUsing(fn ($record) => SelectOptionLabels::generic($record, 'title', 'پیشنهاد'))
            ->searchable()
            ->preload()
            ->required()
            ->columnSpan(3);
    }
}
