<?php

namespace App\Filament\Resources\Partners\Schemas;

use Filament\Forms\Components\Select;
use Filament\Forms\Components\SpatieMediaLibraryFileUpload;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
use Filament\Schemas\Components\Section;
use Filament\Schemas\Schema;

class PartnerForm
{
    public static function configure(Schema $schema): Schema
    {
        return $schema->components([
            Section::make('Partnerschaft')->schema([
                TextInput::make('name')->label('Name')->required()->maxLength(160),
                Select::make('category')->label('Gruppe')->required()->options([
                    'Planung & Projekt' => 'Planung & Projekt',
                    'System & Technologie' => 'System & Technologie',
                ]),
                TextInput::make('website')->label('Website')->url()->maxLength(500)->columnSpanFull(),
                SpatieMediaLibraryFileUpload::make('logo_media')->label('Logo')->collection('logo')->image()->imageEditor()->columnSpanFull(),
                TextInput::make('logo_path')->label('Vorhandener Logo-Pfad')->helperText('Optional für bereits mitgelieferte Website-Logos.')->columnSpanFull(),
                TextInput::make('sort_order')->label('Reihenfolge')->numeric()->required()->default(0),
                Toggle::make('is_published')->label('Veröffentlicht')->required()->default(true),
            ])->columns(2),
        ]);
    }
}
