"use client"; import React, { useEffect, useState } from 'react'; import Link from 'next/link'; import { getScriptEpisodeListNew, MovieProject } from '@/api/script_episode'; import { getFirstFrame } from '@/utils/tools'; import { useRouter } from 'next/navigation'; import { motion } from 'framer-motion'; /** * A lightweight horizontal list of user's movie projects. * Shows first 9 items, clipped horizontally, with a right-side gradient more button. */ const MyMovies: React.FC = () => { const [projects, setProjects] = useState([]); const router = useRouter(); const StatusBadge = (status: string): JSX.Element => { return ( {status === 'pending' && ( <> )} {status === 'failed' && ( <> FAILED )} ); }; useEffect(() => { const user = JSON.parse(localStorage.getItem('currentUser') || '{}'); const userId = String(user.id || '0'); getScriptEpisodeListNew({ user_id: userId, page: 1, per_page: 9 }) .then((res) => { if ((res as any)?.code === 0) { setProjects((res as any).data.movie_projects?.slice(0, 9) || []); } }) .catch(() => {}); }, []); return (

My Projects

All movies →
{projects.map((p) => ( ))}
); }; export default MyMovies;