<?php

declare(strict_types=1);

namespace App\Filament\Components\Form;

use App\Filament\Support\SelectOptionLabels;

use Filament\Forms\Components\Select;

class SourceSelect extends Select
{
    public static function create(): static
    {
        return parent::make('source_id')
            ->label('منبع')
            ->relationship('source', 'name')
            ->getOptionLabelFromRecordUsing(fn ($record) => SelectOptionLabels::generic($record, 'name', 'منبع'))
            ->searchable()
            ->preload()
            ->columnSpan(3);
    }
}
