@extends('layouts.header')

@section('content')
    <div class="container">
        <h1>General Settings</h1>
        
        <!-- Form to update general settings -->
        <form method="POST" action="{{ route('admin.settings.update') }}" enctype="multipart/form-data">
            @csrf

            <!-- Site Name -->
            <div class="mb-3">
                <label for="site_name" class="form-label">Site Name</label>
                <input type="text" class="form-control" id="site_name" name="site_name" value="{{ $generalSettings['site_name'] ?? '' }}">
            </div>

            <!-- Site Description -->
            <div class="mb-3">
                <label for="site_description" class="form-label">Site Description</label>
                <textarea class="form-control" id="site_description" name="site_description">{{ $generalSettings['site_description'] ?? '' }}</textarea>
            </div>

            <!-- Logo Upload -->
            <div class="mb-3">
                <label for="logo" class="form-label">Logo</label>
                <input type="file" class="form-control" id="logo" name="logo">
                @if(isset($generalSettings['logo']))
                <img src="{{ asset($generalSettings['logo']) }}" alt="Site Logo" style="width: 100px; height: 100px;">              @endif
            </div>


            <!-- Privacy Policy -->
<div class="mb-3">
    <label for="privacy_policy" class="form-label">Privacy Policy</label>
    <textarea class="form-control" id="privacy_policy" name="privacy_policy">{{ $generalSettings['privacy_policy'] ?? '' }}</textarea>
</div>

<!-- Terms and Conditions -->
<div class="mb-3">
    <label for="terms_and_conditions" class="form-label">Terms and Conditions</label>
    <textarea class="form-control" id="terms_and_conditions" name="terms_and_conditions">{{ $generalSettings['terms_and_conditions'] ?? '' }}</textarea>
</div>

<!-- About Us -->
<div class="mb-3">
    <label for="about_us" class="form-label">About Us</label>
    <textarea class="form-control" id="about_us" name="about_us">{{ $generalSettings['about_us'] ?? '' }}</textarea>
</div>

            <!-- Submit Button -->
            <button type="submit" class="btn btn-primary">Save Settings</button>
        </form>
    </div>
@endsection
