Skip to content

Commit 7f8e7ed

Browse files
linter errors fixed
1 parent e04128f commit 7f8e7ed

7 files changed

Lines changed: 22 additions & 11 deletions

File tree

frontend/app/dashboard/billing/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ function BillingPageContent() {
9696
}
9797
}
9898

99-
const { start, end } = useMemo(() => getMonthWindow(new Date()), []);
99+
const { end } = useMemo(() => getMonthWindow(new Date()), []);
100100

101101
const loadBilling = async () => {
102102
setLoading(true);

frontend/app/dashboard/history/page.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"use client";
22

3+
import Image from "next/image";
34
import { useEffect, useState } from "react";
45
import { createClient } from "@/lib/supabase/client";
56
import { ChevronRight } from "lucide-react";
@@ -210,11 +211,14 @@ export default function HistoryPage() {
210211
</p>
211212
</div>
212213

213-
<div className="overflow-hidden rounded-lg border border-border bg-muted/20">
214+
<div className="relative min-h-[180px] overflow-hidden rounded-lg border border-border bg-muted/20">
214215
{selectedScan.image_url ? (
215-
<img
216+
<Image
216217
src={selectedScan.image_url}
217218
alt="Scan capture"
219+
width={1200}
220+
height={900}
221+
unoptimized
218222
className="h-auto max-h-[340px] w-full object-contain"
219223
/>
220224
) : (

frontend/app/dashboard/usage/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default function UsagePage() {
2121
const [numScans, setNumScans] = useState<number>(0);
2222
const [nextBillingDate, setNextBillingDate] = useState<string | null>(null);
2323

24-
const { start, end } = useMemo(() => getMonthWindow(new Date()), []);
24+
const { end } = useMemo(() => getMonthWindow(new Date()), []);
2525

2626
useEffect(() => {
2727
const loadUsage = async () => {
@@ -94,7 +94,7 @@ export default function UsagePage() {
9494
renewsOn={nextBillingDate ? new Date(nextBillingDate) : end}
9595
/>
9696
) : (
97-
<FreeUsageCard used={numScans} resetOn={end} />
97+
<FreeUsageCard used={numScans} />
9898
)
9999
)}
100100
</div>

frontend/components/new-image/image-upload-zone.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"use client";
22

3+
import Image from "next/image";
34
import { Button } from "@/components/ui/button";
45
import { cn } from "@/lib/utils";
56
import { ClipboardPaste, ImagePlus, Loader2, Upload, X } from "lucide-react";
@@ -56,11 +57,14 @@ export function ImageUploadZone({
5657

5758
{imageData ? (
5859
<div className="relative flex min-h-[280px] flex-col items-center justify-center p-6 sm:min-h-[320px]">
59-
<div className="relative max-h-[320px] overflow-hidden rounded-lg border border-border bg-background shadow-sm">
60-
<img
60+
<div className="relative h-[min(320px,70vh)] w-full max-w-full overflow-hidden rounded-lg border border-border bg-background shadow-sm">
61+
<Image
6162
src={imageData}
6263
alt="Pasted or uploaded preview"
63-
className="max-h-[300px] w-auto max-w-full object-contain sm:max-h-[320px]"
64+
fill
65+
unoptimized
66+
className="object-contain"
67+
sizes="(max-width: 640px) 100vw, 36rem"
6468
/>
6569
</div>
6670
<div className="mt-4 flex flex-wrap items-center justify-center gap-2">

frontend/components/usage-cards.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function UsageMeter({ used, limit }: { used: number; limit: number }) {
3737
);
3838
}
3939

40-
export function FreeUsageCard({ used, resetOn }: { used: number; resetOn: Date }) {
40+
export function FreeUsageCard({ used }: { used: number }) {
4141
const limit = 5;
4242
const remaining = Math.max(0, limit - used);
4343

frontend/hooks/use-scan-usage.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ export function useScanUsage() {
2828
}, []);
2929

3030
useEffect(() => {
31-
void loadUsage();
31+
const run = () => {
32+
void loadUsage();
33+
};
34+
queueMicrotask(run);
3235
}, [loadUsage]);
3336

3437
const limit = isPro ? 50 : 5;

frontend/lib/supabase/proxy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export async function updateSession(request: NextRequest) {
1515
return request.cookies.getAll()
1616
},
1717
setAll(cookiesToSet) {
18-
cookiesToSet.forEach(({ name, value, options }) => request.cookies.set(name, value))
18+
cookiesToSet.forEach(({ name, value }) => request.cookies.set(name, value))
1919
supabaseResponse = NextResponse.next({
2020
request,
2121
})

0 commit comments

Comments
 (0)