<?php

namespace App\Filament\Pages;

use App\Settings\CtaSettings;
use Filament\Forms;
use Filament\Forms\Components\FileUpload;
use Filament\Forms\Form;
use Filament\Pages\SettingsPage;

class ManageCtaSettings extends SettingsPage
{
    protected static ?string $navigationGroup = 'Home';

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

    protected static string $settings = CtaSettings::class;

    public static function getNavigationLabel(): string
    {
        return 'Call To Action';
    }

    public function form(Form $form): Form
    {
        return $form
            ->schema([
                Forms\Components\TextInput::make('title')
                    ->label('Call To Action Title')
                    ->required(),
                Forms\Components\TextInput::make('button_text')
                    ->label('Button Text')
                    ->required(),
                Forms\Components\TextInput::make('button_url')
                    ->label('Button URL')
                    ->required()
                    ->url(),
                FileUpload::make('background_image')
                    ->label('Background Image 1320x408')
                    ->directory('settings')
                    ->image()
                    ->columnSpan('full'),
            ]);
    }
}
