<?php

declare(strict_types=1);

namespace App\Filament\Components\Form;

use Filament\Forms\Components\Select;

class ReplySelect extends Select
{
    public static function create(): static
    {
        return parent::make('reply_id')
            ->label('پاسخ')
            ->relationship('reply')
            ->preload()
            ->columnSpan(4)
            ->getOptionLabelFromRecordUsing(function ($record) {
                return $record->message ?: $record->id;
            });
    }
}
