<?php

declare(strict_types=1);

namespace App\Filament\Components\Form;

use App\Filament\Support\SelectOptionLabels;

use Filament\Forms\Components\Select;

class ConversationSelect extends Select
{
    public static function create(): static
    {
        return parent::make('conversation_id')
            ->relationship('conversation', 'id')
            ->getOptionLabelFromRecordUsing(fn ($record) => SelectOptionLabels::generic($record, 'id', 'گفتگو'))
            ->label('گفتگو')
            ->searchable()
            ->preload()
            ->columnSpan(4);
    }
}
