Add automated content planning and image overlays

This commit is contained in:
Loma Bot Ops
2026-11-27 08:48:41 +07:00
parent bb840a54ff
commit 1d3bd3e7cd
10 changed files with 411 additions and 133 deletions
+2 -1
View File
@@ -7,6 +7,7 @@ import { Icon } from "@/components/Icon";
import { WeekBoard } from "@/components/WeekBoard";
import { WeekPlanAssistant } from "@/components/WeekPlanAssistant";
import { roleAtLeast } from "@/lib/auth/roles";
import { ContentAutoLauncher } from "@/components/ContentAutoLauncher";
export default async function OverviewPage(props: PageProps<"/">) {
const ctx = await getConsoleContext();
@@ -39,7 +40,7 @@ export default async function OverviewPage(props: PageProps<"/">) {
const openDays = Array.from({ length: 7 }, (_, i) => addDays(week, i)).filter(d => d >= today).length;
const planFor = ctx.selected && editable.includes(ctx.selected.id) && openDays > 0 ? ctx.selected : null;
return <>
<PageTitle title="แผนคอนเทนต์" subtitle={ctx.selected ? `จัดคิวโพสต์ของ ${ctx.selected.name}` : "ทุกไอเดีย ทุกเพจ ในแผนเดียว · เวลาไทย"} actions={editable.length > 0 ? <Link href="/posts/new" className="btn btn-primary"><Icon name="plus" /> สร้างโพสต์</Link> : undefined} />
<PageTitle title="แผนคอนเทนต์" subtitle={ctx.selected ? `จัดคิวโพสต์ของ ${ctx.selected.name}` : "ทุกไอเดีย ทุกเพจ ในแผนเดียว · เวลาไทย"} actions={editable.length > 0 ? <>{planFor && <ContentAutoLauncher pageId={planFor.id} />}<Link href="/posts/new" className="btn btn-primary"><Icon name="plus" /> สร้างโพสต์</Link></> : undefined} />
<div className="flex flex-wrap items-center gap-3 text-[12px] text-ink-3">
<span>{posts.length} โพสต์ในสัปดาห์นี้</span><span className="w-1 h-1 bg-line rounded-full" /><span>{tray.length}{tray.length === 50 ? "+" : ""} โพสต์ยังไม่วางวัน</span>
{pending > 0 && <Link href="/posts?status=PENDING_APPROVAL" className="pill pill-amber">รออนุมัติ {pending}</Link>}