<?php

declare(strict_types=1);

namespace App\Filament\Components\Form;

use App\Filament\Support\SelectOptionLabels;

use Filament\Forms\Components\Select;

class CouponSelect extends Select
{
    public static function create(): static
    {
        return parent::make('coupon_id')
            ->label('کupon')
            ->relationship('coupon', 'code')
            ->getOptionLabelFromRecordUsing(fn ($record) => SelectOptionLabels::generic($record, 'code', 'کوپن'))
            ->searchable()
            ->preload()
            ->columnSpan(6);
    }
}
