From e72897e55b57a63a567e03c20856ce6e46865327 Mon Sep 17 00:00:00 2001 From: gunshiz Date: Thu, 3 Sep 2026 23:24:51 +0700 Subject: [PATCH] feat : update --- bun.lock | 2 - components/admin/guide-overview-form.tsx | 13 +- components/admin/guide-section-editor.tsx | 254 ++++++++++++++++++++-- components/public/team-search.tsx | 41 +++- components/ui/checkbox.tsx | 29 +++ lib/guides/team-tools.test.ts | 35 +++ lib/guides/team-tools.ts | 115 ++++++++++ lib/guides/validation-messages.test.ts | 8 + lib/guides/validation-messages.ts | 13 +- package.json | 1 - 10 files changed, 481 insertions(+), 30 deletions(-) create mode 100644 components/ui/checkbox.tsx create mode 100644 lib/guides/team-tools.test.ts create mode 100644 lib/guides/team-tools.ts diff --git a/bun.lock b/bun.lock index f44160f..c1d0ba9 100644 --- a/bun.lock +++ b/bun.lock @@ -17,7 +17,6 @@ "discord.js": "^14.27.0", "drizzle-orm": "^0.45.2", "embla-carousel-react": "^8.6.0", - "fflate": "^0.8.3", "ioredis": "^6.0.0", "lucide-react": "^1.35.0", "modern-screenshot": "^4.7.0", @@ -954,7 +953,6 @@ "fdir": ["fdir@6.5.0", "", { "peerDependencies": { "picomatch": "^3 || ^4" }, "optionalPeers": ["picomatch"] }, "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg=="], - "fflate": ["fflate@0.8.3", "", {}, "sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA=="], "figures": ["figures@6.1.0", "", { "dependencies": { "is-unicode-supported": "^2.0.0" } }, "sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg=="], diff --git a/components/admin/guide-overview-form.tsx b/components/admin/guide-overview-form.tsx index 4dd142e..e6349e7 100644 --- a/components/admin/guide-overview-form.tsx +++ b/components/admin/guide-overview-form.tsx @@ -26,6 +26,7 @@ import { Textarea } from "@/components/ui/textarea"; import { useAutosave } from "@/hooks/use-autosave"; import { adminDraftKey } from "@/lib/editor/local-draft"; import { parseYouTubeUrl } from "@/lib/guides/youtube"; +import { cn } from "@/lib/utils"; export function GuideOverviewForm({ guide, @@ -55,6 +56,8 @@ export function GuideOverviewForm({ !overview.trim() ? "กรุณากรอก Overview" : null, invalidYoutubeUrl ? "กรุณาใส่ลิงก์วิดีโอ YouTube ที่ถูกต้อง" : null, ].filter((issue): issue is string => Boolean(issue)); + const invalidCover = !cover.id; + const invalidOverview = !overview.trim(); const localDraft = { overview, youtubeUrl, cover }; const autosave = useAutosave({ value, @@ -107,9 +110,12 @@ export function GuideOverviewForm({ - + Guide Image -
+
{`Guide setCover(asset)} /> - + Overview