Add image art direction, Thai date picker on week board, sturdier image download
- Share IMAGE_ART_DIRECTION between editable image prompts and queued post drafts - Use ThaiDateTimePicker for week board planning; a11y, clear action, mobile layout - Show planned day in Thai format in the generation queue - Wait longer for ChatGPT image download and handle the download menu item Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,12 @@ function duration(job: PostJobView): string {
|
||||
return `${Math.floor(seconds / 60)} นาที ${seconds % 60} วินาที`;
|
||||
}
|
||||
|
||||
function formatPlannedDay(value: string): string {
|
||||
const [year, month, day] = value.split("-").map(Number);
|
||||
if (!year || !month || !day) return value;
|
||||
return new Intl.DateTimeFormat("th-TH", { day: "numeric", month: "long", year: "numeric", timeZone: "Asia/Bangkok" }).format(new Date(Date.UTC(year, month - 1, day, -7)));
|
||||
}
|
||||
|
||||
/** Server-persisted jobs are rediscovered after reload; the browser never executes the pipeline. */
|
||||
export function PostGenerationQueue({ pageId, targets, plannedDay, initialTopic }: {
|
||||
pageId: string; targets: ("FACEBOOK" | "INSTAGRAM")[]; plannedDay: string; initialTopic: string;
|
||||
@@ -81,7 +87,7 @@ export function PostGenerationQueue({ pageId, targets, plannedDay, initialTopic
|
||||
<span>หัวข้อโพสต์ที่จะเข้าคิว</span>
|
||||
<textarea className="textarea" rows={2} value={topic} disabled={busy} maxLength={1000} onChange={(event) => { setTopic(event.target.value); requestKey.current = null; }} placeholder="เช่น แนะนำเมนูใหม่ พร้อมราคาและจุดเด่นที่ต้องการสื่อ" />
|
||||
</label>
|
||||
<p className="text-[12px] text-ink-2">ฉบับร่างสำหรับ {targets.length ? targets.map((target) => target === "FACEBOOK" ? "Facebook" : "Instagram").join(" + ") : "ยังไม่ได้เลือกช่องทาง"}{plannedDay ? ` · วันวางแผน ${plannedDay}` : " · ยังไม่วางวัน"}</p>
|
||||
<p className="text-[12px] text-ink-2">ฉบับร่างสำหรับ {targets.length ? targets.map((target) => target === "FACEBOOK" ? "Facebook" : "Instagram").join(" + ") : "ยังไม่ได้เลือกช่องทาง"}{plannedDay ? ` · วันวางแผน ${formatPlannedDay(plannedDay)}` : " · ยังไม่วางวัน"}</p>
|
||||
<div className="flex flex-wrap gap-2 items-center">
|
||||
<button type="button" className="btn btn-primary btn-sm" disabled={busy || !topic.trim() || targets.length === 0} onClick={enqueue}>
|
||||
<Icon name="sparkle" size={15} /> {busy ? "กำลังรับงาน…" : "เข้าคิวสร้างโพสต์"}
|
||||
|
||||
Reference in New Issue
Block a user