From c9431dcffcc463fec6b48fb82c8ace6bf688fda8 Mon Sep 17 00:00:00 2001 From: mbaharip <62494292+mbahArip@users.noreply.github.com> Date: Wed, 8 May 2024 08:55:40 +0700 Subject: [PATCH] Update preview logic --- src/app/@preview.audio.tsx | 75 +++++++++--- src/app/@preview.doc.tsx | 55 +++++++-- src/app/@preview.image.tsx | 75 ++++++++++-- src/app/@preview.layout.tsx | 95 ++++++++++----- src/app/@preview.manga.tsx | 229 ++++++++++++++++++++++++++++-------- src/app/@preview.rich.tsx | 21 ++-- src/app/@preview.video.tsx | 48 ++++---- 7 files changed, 447 insertions(+), 151 deletions(-) diff --git a/src/app/@preview.audio.tsx b/src/app/@preview.audio.tsx index eaf7e51..ba5d2dc 100644 --- a/src/app/@preview.audio.tsx +++ b/src/app/@preview.audio.tsx @@ -1,7 +1,7 @@ "use client"; +import dynamic from "next/dynamic"; import { useEffect, useState } from "react"; -import AudioPlayer from "react-h5-audio-player"; import "react-h5-audio-player/lib/styles.css"; import { z } from "zod"; import { Schema_File } from "~/schema"; @@ -10,7 +10,27 @@ import { cn } from "~/utils"; import Icon from "~/components/Icon"; import { CreateDownloadToken } from "./actions"; -import "./r5-style.css"; + +// import "./r5-style.css"; + +const Plyr = dynamic(() => import("plyr-react"), { + ssr: false, + loading: () => ( +
Loading player...
++ Looks like this file size exceed the preview size limit +
+Loading manga content...
+Please wait while we downloading the content for preview
+Loading player...
+