@props([ 'board', 'post', 'mediaRatioClass' => 'aspect-[16/10]', ]) @php $thumbnailUrl = method_exists($post, 'thumbnailUrl') ? $post->thumbnailUrl() : ($post->thumbnail_url ?? null); $authorName = $post->user?->name ?? ($post->guest_name ?? '익명'); $shareUrl = method_exists($post, 'resolvePostUrl') ? $post->resolvePostUrl() : tenant_url(null, $board->slug . '/' . $post->slug); $shareTitle = $post->title; $shareImage = $thumbnailUrl ?: ''; $socialButtons = collect([ [ 'key' => 'facebook', 'label' => 'Facebook', 'href' => 'https://www.facebook.com/sharer/sharer.php?u=' . urlencode($shareUrl), 'icon' => '', ], [ 'key' => 'x', 'label' => 'X', 'href' => 'https://twitter.com/intent/tweet?url=' . urlencode($shareUrl) . '&text=' . urlencode($shareTitle), 'icon' => '', ], [ 'key' => 'kakao', 'label' => 'KakaoTalk', 'href' => 'https://story.kakao.com/s/share?url=' . urlencode($shareUrl), 'icon' => '', ], [ 'key' => 'naver-blog', 'label' => 'Naver Blog', 'href' => 'https://share.naver.com/web/shareView.nhn?url=' . urlencode($shareUrl) . '&title=' . urlencode($shareTitle), 'icon' => '', ], [ 'key' => 'linkedin', 'label' => 'LinkedIn', 'href' => 'https://www.linkedin.com/sharing/share-offsite/?url=' . urlencode($shareUrl), 'icon' => '', ], [ 'key' => 'pinterest', 'label' => 'Pinterest', 'href' => 'https://pinterest.com/pin/create/button/?url=' . urlencode($shareUrl) . '&media=' . urlencode($shareImage) . '&description=' . urlencode($shareTitle), 'icon' => '', ], ])->filter(fn (array $button): bool => filled($button['href'] ?? null)); @endphp @if ($thumbnailUrl) @else {{ $board->title }} {{ $post->title }} @endif {{ $board->title }} {{ $authorName }} {{ $post->title }} @foreach ($socialButtons as $button) {!! $button['icon'] !!} @endforeach