diff --git a/app/discover/page.tsx b/app/discover/page.tsx
index f381ac6..b30408f 100644
--- a/app/discover/page.tsx
+++ b/app/discover/page.tsx
@@ -4,22 +4,20 @@ import { cookies } from "next/headers";
import config from "@/config";
import { Metadata } from "next";
-type Status = "idle" | "pending" | "success" | "error"
-
+type Status = "idle" | "pending" | "success" | "error";
const { apiUrl, token } = config;
-
export const metadata: Metadata = {
title: "Vilm - Discover Movies and Tv Shows ",
- description: 'Discover movies and tv shows.',
-}
+ description: "Discover movies and tv shows.",
+};
export default async function Page() {
const { data, status } = await getDiscover();
- if (status === 'pending') {
- return "Loading..."
+ if (status === "pending") {
+ return "Loading...";
}
return (
@@ -32,8 +30,11 @@ export default async function Page() {
);
}
-
-async function getDiscover(): Promise<{ data: Response | null, status: Status, error: string | null }> {
+async function getDiscover(): Promise<{
+ data: Response | null;
+ status: Status;
+ error: string | null;
+}> {
const apiToken = cookies().get("API_TOKEN")?.value ?? token;
let status: Status = "idle";
let data: Response | null = null;
@@ -41,23 +42,21 @@ async function getDiscover(): Promise<{ data: Response | null, status
status = "pending";
try {
- const response = await fetch(`${apiUrl}/trending/all/day`,
- {
- method: "GET",
- headers: {
- "Content-Type": "application/json",
- "Accept": "application/json",
- Authorization: `Bearer ${apiToken}`,
- },
- });
+ const response = await fetch(`${apiUrl}/trending/all/day`, {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ Authorization: `Bearer ${apiToken}`,
+ },
+ });
if (!response.ok) {
- throw new Error('Failed to fetch the movie data');
+ throw new Error("Failed to fetch the movie data");
}
data = await response.json();
status = "success";
-
} catch (err) {
console.error(err);
status = "error";
@@ -66,4 +65,3 @@ async function getDiscover(): Promise<{ data: Response | null, status
return { data, status, error };
}
-
diff --git a/app/layout.tsx b/app/layout.tsx
index 91d0a7c..17f082c 100644
--- a/app/layout.tsx
+++ b/app/layout.tsx
@@ -3,37 +3,36 @@ import "../src/index.css";
import Navbar from "@/components/Navbar";
import Footer from "@/components/Footer";
import { Toaster } from "@/components/ui/toaster";
-import { Metadata } from 'next';
+import { Metadata } from "next";
export const metadata: Metadata = {
- title: 'Vilm',
- description: 'Get movies and tv shows information.',
+ title: "Vilm",
+ description: "Get movies and tv shows information.",
openGraph: {
- siteName: 'Vilm',
- type: 'website',
- url: 'https://vilm-react.vercel.app/',
- title: 'Vilm',
- description: 'Get movies and tv shows information.',
+ siteName: "Vilm",
+ type: "website",
+ url: "https://vilm-react.vercel.app/",
+ title: "Vilm",
+ description: "Get movies and tv shows information.",
images: [
{
- url: '/og-image.jpg',
+ url: "/og-image.jpg",
},
],
},
twitter: {
- card: 'summary_large_image',
- creator: '@nnivxix',
- title: 'Get movies and tv shows information.',
- description: 'Get movies and tv shows information.',
- images: ['/og-image.jpg'],
+ card: "summary_large_image",
+ creator: "@nnivxix",
+ title: "Get movies and tv shows information.",
+ description: "Get movies and tv shows information.",
+ images: ["/og-image.jpg"],
},
};
-
export default function RootLayout({
children,
}: {
- children: React.ReactNode
+ children: React.ReactNode;
}) {
return (
@@ -72,8 +71,6 @@ export default function RootLayout({
href="/backdrop-fallback.png"
type="image/png"
/>
-
-
@@ -83,4 +80,4 @@ export default function RootLayout({