fix: resolve all ruff and ESLint lint errors
Backend (ruff): - F821: Add TYPE_CHECKING imports for Vehicle, Contact, File in models (file.py, retouch.py, sale.py, vehicle.py) - E741: Rename ambiguous variable to / (copilot_service.py, price_compare_service.py, openrouter.py) - F841: Remove unused variable in sale_service.py Frontend (ESLint): - react/no-unescaped-entities: Escape quotes in ContractPreview.tsx - @next/next/no-img-element: Replace <img> with <Image> from next/image (FileGallery.tsx, FileList.tsx, FilePreview.tsx, BeforeAfterSlider.tsx) Tests: 392 backend passed, 112 frontend passed, next build successful
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import { useState, useCallback, useRef, useEffect } from 'react';
|
||||
import Image from 'next/image';
|
||||
|
||||
interface BeforeAfterSliderProps {
|
||||
beforeSrc: string;
|
||||
@@ -78,12 +79,14 @@ export function BeforeAfterSlider({
|
||||
onClick={handleClick}
|
||||
>
|
||||
{/* After image (full, background) */}
|
||||
<img
|
||||
<Image
|
||||
src={afterSrc}
|
||||
alt={afterLabel}
|
||||
className="absolute inset-0 w-full h-full object-cover"
|
||||
fill
|
||||
className="object-cover"
|
||||
data-testid="after-image"
|
||||
draggable={false}
|
||||
unoptimized
|
||||
/>
|
||||
|
||||
{/* Before image (clipped to left of slider) */}
|
||||
@@ -91,13 +94,15 @@ export function BeforeAfterSlider({
|
||||
className="absolute inset-0 overflow-hidden"
|
||||
style={{ width: `${sliderPos}%` }}
|
||||
>
|
||||
<img
|
||||
<Image
|
||||
src={beforeSrc}
|
||||
alt={beforeLabel}
|
||||
className="absolute inset-0 h-full object-cover"
|
||||
fill
|
||||
className="object-cover"
|
||||
style={{ width: `${containerRef.current?.clientWidth || 100}%` }}
|
||||
data-testid="before-image"
|
||||
draggable={false}
|
||||
unoptimized
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user