<?php

namespace Bongo\Builder\Http\Controllers\Api;

use Bongo\Framework\Http\Controllers\AbstractApiController;

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

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

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