<?php

namespace App\Http\Controllers\Api\V1;

use App\Http\Controllers\Controller;
use App\Http\Resources\HeroSlideResource;
use App\Repositories\Contracts\HeroSlideRepositoryInterface;
use Illuminate\Http\Resources\Json\AnonymousResourceCollection;
use OpenApi\Attributes as OA;

class HeroSlideController extends Controller
{
    public function __construct(private HeroSlideRepositoryInterface $repository) {}

    #[OA\Get(
        path: '/api/v1/hero-slides',
        summary: 'Aktif hero slide listesi',
        tags: ['Hero Slides'],
        responses: [new OA\Response(response: 200, description: 'Aktif hero slide listesi')],
    )]
    public function index(): AnonymousResourceCollection
    {
        return HeroSlideResource::collection($this->repository->active());
    }
}
