diff --git a/.env.example b/.env.example index e535ff5..2a6e557 100644 --- a/.env.example +++ b/.env.example @@ -23,10 +23,10 @@ GOOGLE_CLOUD_BUCKET="" # Your Google Cloud Storage Bucket n GOOGLE_APPLICATION_CREDENTIALS_JSON="" # The content of the JSON file you download when creating a service account key # Vercel KV -KV_URL="" # The URL of your Vercel KV instance -KV_REST_API_URL="" # The REST API URL of your Vercel KV instance -KV_REST_API_TOKEN="" # The REST API token for your Vercel KV instance -KV_REST_API_READ_ONLY_TOKEN="" # The read-only REST API token for your Vercel KV instance +# KV_URL="" # The URL of your Vercel KV instance +# KV_REST_API_URL="" # The REST API URL of your Vercel KV instance +# KV_REST_API_TOKEN="" # The REST API token for your Vercel KV instance +# KV_REST_API_READ_ONLY_TOKEN="" # The read-only REST API token for your Vercel KV instance # Upstash_Redis UPSTASH_REDIS_REST_URL="" # REST URL of your Upstash Redis database diff --git a/next.config.js b/next.config.js index dbd9a43..4a9e274 100644 --- a/next.config.js +++ b/next.config.js @@ -8,7 +8,12 @@ await import("./src/env.js"); const config = { swcMinify: false, images: { - domains: ["storage.googleapis.com"], + remotePatterns: [ + { + protocol: "https", + hostname: "storage.googleapis.com", + }, + ], }, async headers() { return [ diff --git a/package.json b/package.json index 22069a8..ed875c4 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,6 @@ "@ungap/with-resolvers": "^0.1.0", "@upstash/ratelimit": "^2.0.5", "@upstash/redis": "^1.33.0", - "@vercel/kv": "^3.0.0", "axios": "^1.8.4", "canvas": "^3.2.0", "class-variance-authority": "^0.7.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 240913b..6a7f3cd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -71,9 +71,6 @@ importers: '@upstash/redis': specifier: ^1.33.0 version: 1.33.0 - '@vercel/kv': - specifier: ^3.0.0 - version: 3.0.0 axios: specifier: ^1.8.4 version: 1.12.2 @@ -1258,10 +1255,6 @@ packages: '@upstash/redis@1.35.7': resolution: {integrity: sha512-bdCdKhke+kYUjcLLuGWSeQw7OLuWIx3eyKksyToLBAlGIMX9qiII0ptp8E0y7VFE1yuBxBd/3kSzJ8774Q4g+A==} - '@vercel/kv@3.0.0': - resolution: {integrity: sha512-pKT8fRnfyYk2MgvyB6fn6ipJPCdfZwiKDdw7vB+HL50rjboEBHDVBEcnwfkEpVSp2AjNtoaOUH7zG+bVC/rvSg==} - engines: {node: '>=14.6'} - '@webassemblyjs/ast@1.14.1': resolution: {integrity: sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==} @@ -4816,10 +4809,6 @@ snapshots: dependencies: uncrypto: 0.1.3 - '@vercel/kv@3.0.0': - dependencies: - '@upstash/redis': 1.35.7 - '@webassemblyjs/ast@1.14.1': dependencies: '@webassemblyjs/helper-numbers': 1.13.2 diff --git a/src/components/Card.tsx b/src/components/Card.tsx index b67540f..e476147 100644 --- a/src/components/Card.tsx +++ b/src/components/Card.tsx @@ -1,6 +1,5 @@ "use client"; -import { useEffect, useState } from "react"; import { type IPaper } from "@/interface"; import Image from "next/image"; import { Eye, Download, Check } from "lucide-react"; @@ -24,22 +23,12 @@ interface CardProps { } const Card = ({ paper, onSelect, isSelected }: CardProps) => { - const [checked, setChecked] = useState(isSelected); - - useEffect(() => { - setChecked(isSelected); - }, [isSelected]); - const handleDownload = async (paper: IPaper) => { await downloadFile(getSecureUrl(paper.file_url), generateFileName(paper)); }; const handleCheckboxChange = () => { - setChecked((prev) => { - const newChecked = !prev; - onSelect(paper, newChecked); - return newChecked; - }); + onSelect(paper, !isSelected); }; const paperLink = `/paper/${paper._id}`; @@ -48,7 +37,7 @@ const Card = ({ paper, onSelect, isSelected }: CardProps) => {
@@ -100,7 +89,7 @@ const Card = ({ paper, onSelect, isSelected }: CardProps) => {