@extends('layouts.dashboard')
@section('content')
@php
/**
* Vendor → Printable menu: every saved fold design as a live preview card (studio-grid),
* plus New / Print / Edit. Shares the ONE studio-grid pattern with TV Screens + QR — no
* page-scoped card styling of its own.
*
* @var array $menus rows: id, name, config
* @var bool $canManage
*/
$menus = $menus ?? [];
$canManage = $canManage ?? false;
@endphp
@php /* .qm-d2: the dashboard density standard (app.css §35) */
@endphp
@php ob_start();
@endphp
@if ($canManage)
{{ t_raw('vendor.print_menu.btn_add') }}
@endif
@php \App\Support\View::slot('subhead', ob_get_clean());
@endphp
{{ t_raw('vendor.print_menu.list_heading') }}
{{ t_raw('vendor.print_menu.subtitle') }}
@if (count($menus) === 0)
{{ t_raw('vendor.print_menu.empty_title') }}
{{ t_raw('vendor.print_menu.empty_body') }}
@if ($canManage)
{{ t_raw('vendor.print_menu.btn_add') }}
@endif
@else
@php
$cards = [];
@endphp
@foreach ($menus as $m)
@php
$mid = (int) $m['id'];
ob_start();
@endphp
{{ t_raw('vendor.print_menu.print_btn') }}
@if ($canManage)
@endif
{{ t_raw('common.edit') }}
@php
$actions = ob_get_clean();
// A double-sided menu's thumbnail shows the FRONT and flips to the BACK on hover (never both sides on
// one card) — same interaction as the admin gallery.
$cfg = \App\Models\PrintMenu::config($m);
$base = url('/vendor/menu/print/' . $mid . '/sheet?mode=preview');
$title = e($m['name']);
if (!empty($cfg['doubleSided'])) {
$media = '
';
} else {
$media = '
';
}
$cards[] = [
'media' => $media,
'href' => url('/vendor/menu/print/' . $mid),
'name' => $m['name'],
'actions' => $actions,
];
@endphp
@endforeach
@php
// 'snap': the sheet itself has square corners (it is paper), so the CARD supplies the rounding — the
// preview is inset as its own rounded snapshot tile instead of running to the card edge.
echo partial('studio-grid', ['cards' => $cards, 'mode' => 'frame', 'cols' => 3, 'ratio' => '4 / 3', 'tone' => 'paper', 'snap' => true]);
@endphp
@endif
@php /* /.qm-d2 */
@endphp
@endsection