<?php

namespace App\Filament\Pages;

use App\Settings\SiteSocialSettings;
use Filament\Forms;
use Filament\Forms\Form;
use Filament\Pages\SettingsPage;
use Illuminate\Contracts\Support\Htmlable;

class ManageSiteSocialSettings extends SettingsPage
{
    protected static ?string $navigationGroup = 'Settings';

    protected static ?string $navigationIcon = 'heroicon-o-share';

    protected static string $settings = SiteSocialSettings::class;

    public function form(Form $form): Form
    {
        return $form
            ->schema([
                Forms\Components\Section::make('Social Media Profiles')
                    ->description('Links to your social media profiles')
                    ->icon('heroicon-o-link')
                    ->collapsible()
                    ->schema([
                        Forms\Components\Grid::make()->schema([
                            Forms\Components\TextInput::make('facebook_url')
                                ->label('Facebook URL')
                                ->required()
                                ->prefix('https://')
                                ->helperText('e.g., facebook.com/yourpage'),
                            Forms\Components\TextInput::make('twitter_url')
                                ->label('Twitter/X URL')
                                ->required()
                                ->prefix('https://')
                                ->helperText('e.g., twitter.com/yourusername'),
                            Forms\Components\TextInput::make('instagram_url')
                                ->label('Instagram URL')
                                ->required()
                                ->prefix('https://')
                                ->helperText('e.g., instagram.com/yourusername'),
                            Forms\Components\TextInput::make('linkedin_url')
                                ->label('LinkedIn URL')
                                ->required()
                                ->prefix('https://')
                                ->helperText('e.g., linkedin.com/company/yourcompany'),
                        ])->columns(2),
                    ]),
            ])
            ->columns(3)
            ->statePath('data');
    }

    public static function getNavigationGroup(): ?string
    {
        return __('Settings');
    }

    public static function getNavigationLabel(): string
    {
        return 'Social Media';
    }

    public function getTitle(): string|Htmlable
    {
        return 'Site Social Media Settings';
    }

    public function getHeading(): string|Htmlable
    {
        return 'Site Social Media Settings';
    }

    public function getSubheading(): string|Htmlable|null
    {
        return 'Manage your social media profiles and sharing options';
    }
}
