<?php

namespace App\Filament\Pages\Settings\SocialMedia\Schemas;

use App\Filament\Support\CheerfulNotification;
use Filament\Forms\Components\TextInput;
use Filament\Schemas\Components\Grid;
use Filament\Schemas\Components\Section;
use Filament\Schemas\Schema;

class SocialMediaSettingsForm
{
    public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([
                Section::make(fn () => CheerfulNotification::getByKey('settings.social_media.section.title'))
                    ->description(fn () => CheerfulNotification::getByKey('settings.social_media.section.description'))
                    ->schema([
                        Grid::make(2)
                            ->schema([
                                TextInput::make('facebook')
                                    ->label('Facebook')
                                    ->placeholder('https://facebook.com/username')
                                    ->autofocus()
                                    ->autocomplete(false)
                                    ->url(),

                                TextInput::make('twitter')
                                    ->label('Twitter')
                                    ->placeholder('https://twitter.com/username')
                                    ->autocomplete(false)
                                    ->url(),

                                TextInput::make('instagram')
                                    ->label('Instagram')
                                    ->placeholder('https://instagram.com/username')
                                    ->autocomplete(false)
                                    ->url(),

                                TextInput::make('youtube')
                                    ->label('YouTube')
                                    ->placeholder('https://youtube.com/username')
                                    ->autocomplete(false)
                                    ->url(),
                            ]),
                    ])
                    ->columnSpanFull(),
            ]);
    }
}
