<?php

namespace App\Filament\Resources\Products\Schemas;

use Filament\Forms\Components\FileUpload;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\Toggle;
use Filament\Schemas\Schema;

class ProductForm
{
    public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([
                Select::make('category_id')
                    ->label('Kategoriýasy')
                    ->relationship('category', 'name')
                    ->required(),
                TextInput::make('name')
                    ->label('Ady')
                    ->required(),
                Textarea::make('description')
                    ->label('Düşündirişi')
                    ->columnSpanFull(),
                TextInput::make('price')
                    ->label('Bahasy')
                    ->required()
                    ->numeric()
                    ->suffix('TMT'),
                FileUpload::make('image')
                    ->label('Suraty')
                    ->image()
                    ->visibility('public'),
                Toggle::make('is_active')
                    ->label('Işjeňmi')
                    ->default(true)
                    ->required(),
            ]);
    }
}
