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:
soroush.asadi
2026-06-03 17:22:38 +03:30
parent b270ef438d
commit 1cd1e504d9
8 changed files with 285 additions and 2 deletions
@@ -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} />;
}