@props([ 'board', 'posts', 'variant' => 'tenant', 'query' => '', 'currentCategory' => '', 'boardCategories' => [], 'boardIndexAction' => '', 'createAction' => '', 'canCreate' => true, 'searchAction' => '', 'showActions' => true, 'emptyTitle' => '아직 게시글이 없습니다', 'emptyDescription' => '첫 글을 작성해서 게시판을 시작해 보세요.', 'emptyCtaLabel' => '글쓰기', ]) @php $boardCategories = collect($boardCategories ?? []); $currentCategory = trim((string) $currentCategory); $categoryBaseQuery = request()->except(['page', 'category']); $buildCategoryHref = static function (?string $category = null) use ($searchAction, $categoryBaseQuery): string { $query = $categoryBaseQuery; if ($category !== null && $category !== '') { $query['category'] = $category; } else { unset($query['category']); } if ($query === []) { return $searchAction; } return $searchAction . '?' . http_build_query($query); }; @endphp
@if ($showActions) @if ($canCreate && $createAction !== '') {{ $emptyCtaLabel }} @endif @endif @if ($boardCategories->isNotEmpty()) @endif
@if ($posts->count() > 0)
@else @endif