Files
saasshop/resources/views/admin/components/tool_blocked_hint.blade.php

34 lines
1.1 KiB
PHP

@php
/**
* 通用“工具被阻断提示块”。
*
* 用法:
* @include('admin.components.tool_blocked_hint', [
* 'dataRole' => 'xxx-blocked-hint',
* 'reason' => '提示原因',
* // actions: [['label' => '去xxx', 'url' => $url], ...]
* 'actions' => [ ... ],
* ])
*/
$dataRole = (string) ($dataRole ?? '');
$reason = (string) ($reason ?? '');
$actions = (array) ($actions ?? []);
@endphp
<div class="adm-tool-blocked-hint" @if($dataRole !== '') data-role="{{ $dataRole }}" @endif>
<div>提示:{{ $reason }}</div>
@if(count($actions) > 0)
<div class="mt-6 actions gap-10">
@foreach($actions as $a)
@php
$label = (string) ($a['label'] ?? '');
$url = (string) ($a['url'] ?? '');
@endphp
@if($label !== '' && $url !== '')
<a class="btn btn-secondary btn-sm" href="{!! $url !!}">{{ $label }}</a>
@endif
@endforeach
</div>
@endif
</div>