

@extends('admin.layout') <!-- if you have a common admin layout -->

@section('content')
<div class="container mx-auto py-10">
    <h1 class="text-2xl font-bold mb-6">Add New Member</h1>

    @if ($errors->any())
        <div class="mb-4 p-4 bg-red-100 text-red-700 rounded">
            <ul>
                @foreach ($errors->all() as $error)
                    <li>{{ $error }}</li>
                @endforeach
            </ul>
        </div>
    @endif

    <form action="{{ route('members.store') }}" method="POST" enctype="multipart/form-data" class="space-y-4">
        @csrf
        <div>
            <label for="name" class="block font-medium">Name</label>
            <input type="text" name="name" id="name" class="border p-2 rounded w-full" required>
        </div>

        <div>
            <label for="role" class="block font-medium">Role</label>
            <input type="text" name="role" id="role" class="border p-2 rounded w-full" required>
        </div>

        <div>
            <label for="description" class="block font-medium">Description</label>
            <textarea name="description" id="description" class="border p-2 rounded w-full"></textarea>
        </div>

        <div>
            <label for="image" class="block font-medium">Image</label>
            <input type="file" name="image" id="image" class="border p-2 rounded w-full">
        </div>

        <button type="submit" class="bg-red-700 text-white px-4 py-2 rounded hover:bg-red-800">
            Save Member
        </button>
    </form>
</div>
@endsection
