<?php

declare(strict_types=1);

namespace App\Filament\Components\Form;

use App\Filament\Support\SelectOptionLabels;

use Filament\Forms\Components\Select;

class ProjectSelect extends Select
{
    public static function create(): static
    {
        return parent::make('project_id')
            ->label('پروژه')
            ->relationship('project', 'name')
            ->getOptionLabelFromRecordUsing(fn ($record) => SelectOptionLabels::project($record))
            ->searchable()
            ->preload()
            ->columnSpan(6);
    }
}
