feat(dashboard): "My Renders" page for users
- /dashboard/renders: user's own render jobs (live status + progress bar + cancel) and finished exports (thumbnail + size/duration + download); bilingual fa/en - server lib my-renders.ts (user-scoped /v1/renders + /v1/exports via session JWT) - user action routes: POST /api/renders/[id]/cancel, GET /api/exports/[id]/download (presigned URL) - dashboard sidebar: "رندرهای من / My Renders" nav item Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import type { Metadata } from "next";
|
||||
|
||||
import { MyRenders } from "@/components/dashboard/MyRenders";
|
||||
import { ACTIVE_STEPS, listMyExports, listMyRenders } from "@/lib/api/my-renders";
|
||||
import { createPageMetadata } from "@/lib/metadata";
|
||||
|
||||
export const metadata: Metadata = createPageMetadata({
|
||||
title: "My Renders",
|
||||
description: "Your render jobs and finished videos.",
|
||||
path: "/dashboard/renders",
|
||||
});
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export default async function MyRendersPage() {
|
||||
const [allJobs, exports] = await Promise.all([listMyRenders(), listMyExports()]);
|
||||
// Show active/failed jobs in the "processing" section; Done ones live as exports.
|
||||
const jobs = allJobs.filter((j) => ACTIVE_STEPS.has(j.step) || j.step === "Failed");
|
||||
return <MyRenders jobs={jobs} exports={exports} />;
|
||||
}
|
||||
Reference in New Issue
Block a user