refactoring: upgrade nextjs; api => server actions

This commit is contained in:
ner committed 2024-01-06 12:55:11 +02:00
1 parent 447be7d021
commit 03cfacf91c
45 files changed
+1034 -923

No files matched your search

@@ -1,5 +1,7 @@
import { FC, useEffect, useRef } from 'react';
import { motion, useAnimation, useInView } from 'framer-motion';
'use client';
import { FC } from 'react';
import { motion } from 'framer-motion';
import { User2 } from 'lucide-react';
import Image from 'next/image';
import { useRouter } from 'next/navigation';
+1 -1
View File
@@ -20,7 +20,7 @@ const Poster: FC<Props> = ({ title, poster, width, height, size = 250, className
>
{poster ? (
<Image
className='rounded-lg mx-auto'
className='rounded-lg mx-auto w-auto'
unoptimized
height={height}
width={width}
+3 -7
View File
@@ -1,23 +1,19 @@
'use client';
import { FC, useState } from 'react';
import Marquee from 'react-fast-marquee';
import { useTheme } from '@/hooks/useTheme';
interface Props {
title: string;
hideGradient?: boolean;
className?: string;
}
const Title: FC<Props> = ({ title, hideGradient, className }) => {
const Title: FC<Props> = ({ title, className }) => {
const [isScrollableTitle, setIsScrollableTitle] = useState(false);
const [theme] = useTheme();
return (
<Marquee
play={isScrollableTitle}
gradient={!hideGradient && isScrollableTitle}
gradientWidth={10}
gradientColor={theme === 'light' ? [255, 255, 255] : [2, 8, 23]}
className={`movie-title overflow-hidden h-[30px] text-lg font-semibold ${className}`}
>
<div
@@ -6,10 +6,10 @@ import { atomWithStorage } from 'jotai/utils';
import { Cast, Loader, Magnet } from 'lucide-react';
import useTorrents from '@/app/(site)/useTorrents';
import { ORDER } from '@/app/api/torrents/parsers/pirate-bay';
import { Modal } from '@/components/ui/dialog';
import { Input } from '@/components/ui/input';
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table';
import { ORDER } from '@/lib/api/parsers/pirate-bay';
interface Props extends InstanceProps<void> {
title: string;
@@ -102,7 +102,7 @@ const Torrents: FC<Props> = ({ title, isOpen, onResolve }) => {
<div className='flex gap-2 m-auto justify-center'>
{host ? (
<a
onClick={handleCast(torrent.magnet)}
onClick={handleCast(torrent.magnet!)}
className='flex items-center justify-center h-8 w-8 border rounded-lg'
>
<Cast size={20} />