@section('title', __('radio.alexa_title')) @section('head') @endsection @php $breadcrumb = [ ['label' => __('general.header_nav_radio')], ['label' => __('radio.menu_item_5')], ['label' => __('radio.alexa_title')], ]; $status = $skill ? (string) $skill->status : null; $states = [ '0' => ['icon' => 'fa-hourglass-half', 'title' => __('radio.alexa_sent_h1'), 'text' => __('radio.alexa_sent_h2'), 'tag' => __('radio.alexa_tag_pending'), 'tone' => 'wait'], '1' => ['icon' => 'fa-circle-check', 'title' => __('radio.alexa_state_live_title'), 'text' => __('radio.alexa_state_live_text'), 'tag' => __('radio.alexa_tag_live'), 'tone' => 'ok'], '2' => ['icon' => 'fa-circle-xmark', 'title' => __('radio.alexa_state_refused_title'), 'text' => __('radio.alexa_state_refused_text'), 'tag' => __('radio.alexa_tag_refused'), 'tone' => 'bad'], '3' => ['icon' => 'fa-magnifying-glass', 'title' => __('radio.alexa_state_review_title'), 'text' => __('radio.alexa_state_review_text'), 'tag' => __('radio.alexa_tag_review'), 'tone' => 'work'], '4' => ['icon' => 'fa-circle-minus', 'title' => __('radio.alexa_state_off_title'), 'text' => __('radio.alexa_state_off_text'), 'tag' => __('radio.alexa_tag_off'), 'tone' => 'bad'], ]; $state = $status !== null ? ($states[$status] ?? $states['0']) : null; /* Recusada e o unico estado que volta a aceitar solicitacao: nos outros quatro o pedido ja esta com alguem. */ $showForm = $siteData->alexa && ($status === null || $status === '2'); $waiting = in_array($status, ['0', '3'], true); $sentAt = $skill && ! empty($skill->created_at) ? strtotime($skill->created_at) : null; $deadline = $sentAt ? date('d/m/Y', strtotime('+' . $reviewDays . ' days', $sentAt)) : null; $pickers = [ ['field' => 'thumbnailImg', 'label' => __('radio.alexa_thumbnail'), 'size' => 108, 'need' => __('radio.alexa_error_thumbnail'), 'help' => __('radio.alexa_help_thumbnail'), 'image' => $images['thumbnail']], ['field' => 'iconImg', 'label' => __('radio.alexa_icon'), 'size' => 512, 'need' => __('radio.alexa_error_icon'), 'help' => __('radio.alexa_help_icon'), 'image' => $images['icon']], ]; @endphp @include('includes/header-novo')
@include('includes.breadcrumb') @include('includes.flash')

{{ __('radio.alexa_title') }}

{{ __('radio.alexa_page_sub') }}

@if($apiError)

{{ $apiError }}

@elseif(! $siteData->alexa)

{{ __('radio.feature_unavailable_plan') }}

{{ __('radio.feature_unavailable_contact') }}

@else @if($state)

{{ $state['title'] }}

{{ $state['text'] }}

@if($status === '1')

{{ __('radio.alexa_phrase_sample', ['name' => $skill->invocation]) }}

@endif @if($waiting && $deadline)

{{ __('radio.alexa_sent_deadline') }} {{ $deadline }}

@endif {{ $state['tag'] }}
{{ __('radio.alexa_label_name') }}
{{ $skill->name }}
{{ __('radio.alexa_label_invocation') }}
{{ $skill->invocation }}
@if($sentAt)

{{ __('radio.alexa_sent_at', ['date' => date('d/m/Y', $sentAt)]) }}

@endif @if($images['thumbnail'] || $images['icon'])
@foreach($pickers as $picker) @if($picker['image'])
{{ $picker['label'] }}
{{ $picker['label'] }}
@endif @endforeach
@endif @if($status === '1' && ! empty($skill->link)) {{ __('radio.alexa_store_link') }} @endif
@endif @if($showForm)
@csrf

{{ $status === '2' ? __('radio.alexa_new_request') : __('radio.alexa_form_title') }}

{{ __('radio.alexa_images_title') }}

@foreach($pickers as $picker)
{{ $picker['label'] }}

{{ $picker['help'] }}

has($picker['field'])) hidden @endif>{{ $errors->first($picker['field']) }}

@endforeach
@endif @endif
@section('scripts') @endsection @include('includes/footer-novo')