<?php

declare(strict_types=1);

namespace App\Filament\Components\Form;

use App\Filament\Support\SelectOptionLabels;

use Filament\Forms\Components\Select;

class VariantSelect extends Select
{
    public static function create(): static
    {
        return parent::make('variant_id')
            ->label('تنوع')
            ->relationship('variant', 'display_name')
            ->getOptionLabelFromRecordUsing(fn ($record) => SelectOptionLabels::generic($record, 'display_name', 'تنوع'))
            ->searchable()
            ->preload()
            ->columnSpan(6);
    }
}
