diff --git a/Common/Card.js b/Common/Card.js index 0ce978d..1591e2b 100644 --- a/Common/Card.js +++ b/Common/Card.js @@ -1,5 +1,6 @@ -import React from 'react'; -import {useRouter } from 'next/router'; +import React from 'react' +import { useRouter } from 'next/router' +import { useTheme } from 'next-themes' function formatBytes(bytes, decimals = 1) { if (!+bytes) return '0 Bytes' @@ -12,46 +13,85 @@ function formatBytes(bytes, decimals = 1) { return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}` } +function cleanMovieNames(movieName) { + const pattern = + /(2160p|1080p|720p|360p|4320p|H265|BluRay|Rip|10 bit|DV|HDR10|ita|eng|AC3|5\.1|sub|Licdom|UpScaled|5 1|su)/gi + const cleanedNames = movieName.replace(pattern, '').trim() -const Card = (props) => { - const router = useRouter(); - let name = props.item[`name`]; - let time = new Date(props.item[`timestamp`]); + return cleanedNames +} + +const Card = props => { + const router = useRouter() + const { theme, setTheme } = useTheme() + let name = props.item[`name`] + let time = new Date(props.item[`timestamp`]) return ( -
{renderYear(year)}
@@ -43,7 +43,7 @@ export default function CardInfo({ className={ isTrending ? 'md:heading-sm text-ellips w-[200px] truncate text-sm font-bold capitalize text-app-pure-white sm:w-[420px] md:h-6' - : 'md:heading-xs text-ellips w-[150px] truncate text-sm font-bold capitalize text-app-pure-white sm:w-[180px] md:w-[200px] lg:w-[268px]' + : 'md:heading-xs text-ellips w-[150px] truncate text-sm font-bold capitalize text-black dark:text-app-pure-white sm:w-[180px] md:w-[200px] lg:w-[268px]' } > {title} @@ -52,7 +52,7 @@ export default function CardInfo({ ) } -function renderYear(year) { +export function renderYear(year) { if (!year) { return 'N/A' } else { @@ -60,15 +60,15 @@ function renderYear(year) { } } -function renderCategoryIcon(category) { +export function renderCategoryIcon(category) { if (category === 'movie') { - return{renderYear(year)}
++ {renderCategoryText(category)} +
+{renderRating(rating)}
*/} +Length
-{length}
+Length
+{length.split("?")[0]}
Language
-{language}
+Language
+{language}
Year
-{year}
+Year
+{year}
Status
-{status}
+Status
+{status}
Language
-{language}
+Language
+{language}
First Air
-{firstAir}
+First Air
+{firstAir}
Last Air
-{lastAir}
+Last Air
+{lastAir}
Status
-{status}
+Status
+{status}
Download
+ +Download
-Play Now
+ )} - - - - {!props?.imdb ? null : ( + {/* {!props?.imdb ? null : (IMDB
- { media_type} -
} + href, + isHomePage, + isTrending, // TODO: Do we need this here? + media_type, + clearHistoryFunction, + iscontinue_watching, + title, + }) { + return ( ++ {media_type} +
} +