diff --git a/app/api/renders/in/route.ts b/app/api/renders/in/route.ts index c62f392..2139e16 100644 --- a/app/api/renders/in/route.ts +++ b/app/api/renders/in/route.ts @@ -8,15 +8,32 @@ export async function GET(request: NextRequest) { return NextResponse.json({ error: "Not authenticated" }, { status: 401 }); } try { + const pageParam = request.nextUrl.searchParams.get("page"); + const pageSizeParam = request.nextUrl.searchParams.get("pageSize"); + const page = Math.max(1, Number(pageParam || 1)); + const pageSize = Math.max(1, Math.min(50, Number(pageSizeParam || 5))); + const offset = (page - 1) * pageSize; + const pool = getPool(); + const countRes = await pool.query( + `SELECT COUNT(*)::int AS count FROM uploaded_files WHERE user_id = $1`, + [userId] + ); + const total = countRes.rows[0]?.count || 0; + const totalPages = Math.max(1, Math.ceil(total / pageSize)); + const result = await pool.query( `SELECT id, original_name, file_path, upload_status, created_at FROM uploaded_files WHERE user_id = $1 - ORDER BY created_at DESC`, - [userId] + ORDER BY created_at DESC + LIMIT $2 OFFSET $3`, + [userId, pageSize, offset] ); - return NextResponse.json({ files: result.rows }); + return NextResponse.json({ + files: result.rows, + pagination: { page, pageSize, total, totalPages }, + }); } catch (err: any) { return NextResponse.json( { error: err.message || "Server error" }, diff --git a/app/contact/page.tsx b/app/contact/page.tsx new file mode 100644 index 0000000..3bc7460 --- /dev/null +++ b/app/contact/page.tsx @@ -0,0 +1,72 @@ +"use client"; + +import Link from "next/link"; +import ContactForm from "@/components/ContactForm"; + +export default function ContactPage() { + return ( +
+ We look forward to hearing from you and helping you find the perfect + cloud solution for your needs. Our team of experts is ready to + assist you with any questions or concerns you may have. +
++ Looking to start a project with us? +
+| Filename | -Status | -Uploaded At | -Download | -Actions | -|||||
|---|---|---|---|---|---|---|---|---|---|
| {f.original_name} | -- - {f.upload_status} - - | -- {new Date(f.created_at).toLocaleString()} - | -- - Download - - | -- - | + <> +
| Filename | +Status | +Uploaded At | +Download | +Actions |
|---|
Phone Support
++1 (555) 123-4567
++ Available 24/7 for urgent matters +
+Sales Inquiries
+ + sales@reya.cloud + +Technical Support
+ + support@reya.cloud + +Report Abuse
+ + abuse@reya.cloud + +Sales Department
++ Monday - Friday: 9:00 AM - 6:00 PM EST +
+Technical Support
+24/7/365
++ Priority support for enterprise customers +
++ For urgent matters outside of business hours, please use our + 24/7 phone support or submit a ticket through your customer + portal. +
+