<?php

namespace Bongo\Builder\Http\Controllers\Api;

use Bongo\Framework\Http\Controllers\AbstractApiController;

class CarouselController extends AbstractApiController
{
    public function index(string $style)
    {
        $style = str_replace('-', '_', $style);

        if (view()->exists("builder::frontend.carousels.{$style}")) {
            return view("builder::frontend.carousels.{$style}")->render();
        }

        return view('builder::frontend.carousels.style_1')->render();
    }
}
