feat : add thanks page

This commit is contained in:
2026-09-04 20:48:55 +07:00 Unverified
parent 06d0287433
commit ba3e81e9cc
8 changed files with 199 additions and 6 deletions
+15 -3
View File
@@ -47,9 +47,8 @@ export function GuideOverviewForm({
id: guide.coverMediaId,
url: guide.coverUrl,
});
const invalidYoutubeUrl = Boolean(
youtubeUrl.trim() && !parseYouTubeUrl(youtubeUrl.trim()),
);
const youtubeVideo = parseYouTubeUrl(youtubeUrl.trim());
const invalidYoutubeUrl = Boolean(youtubeUrl.trim() && !youtubeVideo);
const value = { coverMediaId: cover.id, overview, youtubeUrl };
const incompleteIssues = [
!cover.id ? "กรุณาอัปโหลด Guide Image" : null,
@@ -156,6 +155,19 @@ export function GuideOverviewForm({
{invalidYoutubeUrl ? (
<FieldError>กรุณาใส่ลิงก์วิดีโอ YouTube ที่ถูกต้อง</FieldError>
) : null}
{youtubeVideo ? (
<div className="aspect-video w-full overflow-hidden rounded-xl border bg-muted">
<iframe
src={youtubeVideo.embedUrl}
title={`ตัวอย่างวิดีโอไกด์ ${guide.name}`}
loading="lazy"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerPolicy="strict-origin-when-cross-origin"
allowFullScreen
className="size-full"
/>
</div>
) : null}
</Field>
</FieldGroup>
</CardContent>