fix(lint&types): resolve all lint warnings, typecheck errors and effect state updates across frontend application and admin panel
This commit is contained in:
1 parent
920dd532e8
commit
c1b2f416ed
29 files changed
+442
-352
No files matched your search
@@ -1,13 +1,24 @@
|
||||
"use client";
|
||||
import React, { useState } from "react";
|
||||
import { Play, PlayCircle, Star, ShieldCheck, X } from "lucide-react";
|
||||
import { Play, Star, ShieldCheck, X } from "lucide-react";
|
||||
import { motion, AnimatePresence } from "motion/react";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/navigation";
|
||||
import SafeImage from "./SafeImage";
|
||||
import { useSettingsStore } from "../lib/store/settingsStore";
|
||||
import { videoService, Video } from "../lib/services/videoService";
|
||||
|
||||
export interface TestimonialItem {
|
||||
id?: string;
|
||||
clinicName?: string;
|
||||
vetName?: string;
|
||||
imageUrl?: string;
|
||||
quote?: string;
|
||||
title?: string;
|
||||
thumbnail?: string;
|
||||
videoUrl?: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
const FALLBACK_VIDEOS = [
|
||||
{
|
||||
id: "v1",
|
||||
@@ -38,11 +49,10 @@ const FALLBACK_VIDEOS = [
|
||||
}
|
||||
];
|
||||
|
||||
export default function VetGallery({ testimonials = [] }: { testimonials?: any[] }) {
|
||||
const router = useRouter();
|
||||
export default function VetGallery({ testimonials = [] }: { testimonials?: TestimonialItem[] }) {
|
||||
const getText = useSettingsStore(state => state.getText);
|
||||
const [apiVideos, setApiVideos] = useState<Video[]>([]);
|
||||
const [selectedVideo, setSelectedVideo] = useState<any>(null);
|
||||
const [selectedVideo, setSelectedVideo] = useState<any | null>(null);
|
||||
|
||||
React.useEffect(() => {
|
||||
videoService.getVideos({ featured: true, limit: 3 }).then((data) => {
|
||||
@@ -55,13 +65,13 @@ export default function VetGallery({ testimonials = [] }: { testimonials?: any[]
|
||||
const displayItems = testimonials.length > 0
|
||||
? testimonials.map((t, idx) => ({
|
||||
id: t.id || `t-${idx}`,
|
||||
title: t.clinicName ? `${t.vetName} — ${t.clinicName}` : t.vetName,
|
||||
doctor: t.vetName,
|
||||
title: t.clinicName ? `${t.vetName} — ${t.clinicName}` : (t.vetName || ''),
|
||||
doctor: t.vetName || '',
|
||||
duration: "۰۲:۰۰",
|
||||
thumbnail: t.imageUrl || "https://images.unsplash.com/photo-1576091160550-217359f42f8c?auto=format&fit=crop&q=80&w=400",
|
||||
videoUrl: "https://www.w3schools.com/html/mov_bbb.mp4",
|
||||
description: t.quote,
|
||||
quote: t.quote
|
||||
description: t.quote || '',
|
||||
quote: t.quote || ''
|
||||
}))
|
||||
: (apiVideos.length > 0 ? apiVideos : FALLBACK_VIDEOS);
|
||||
|
||||
@@ -102,7 +112,7 @@ export default function VetGallery({ testimonials = [] }: { testimonials?: any[]
|
||||
<div className="absolute inset-0 bg-medical-gray-900/20 group-hover:bg-transparent transition-colors z-10" />
|
||||
<SafeImage
|
||||
src={video.thumbnail || video.imageUrl || '/images/vets/vet1.webp'}
|
||||
alt={video.title || video.vetName}
|
||||
alt={video.title || video.vetName || 'ویدیو دامپزشک'}
|
||||
className="w-full h-full"
|
||||
imgClassName="object-cover grayscale-[30%] group-hover:grayscale-0 transition-all duration-700"
|
||||
/>
|
||||
@@ -117,7 +127,7 @@ export default function VetGallery({ testimonials = [] }: { testimonials?: any[]
|
||||
</div>
|
||||
</div>
|
||||
<h4 className="text-lg font-black text-medical-gray-900 mb-2 group-hover:text-canina-blue transition-colors leading-tight font-vazir">
|
||||
{video.title || video.quote?.substring(0, 40) + '...'}
|
||||
{video.title || (video.quote ? video.quote.substring(0, 40) + '...' : '')}
|
||||
</h4>
|
||||
<div className="flex items-center gap-2 text-medical-gray-500 font-bold text-sm font-vazir">
|
||||
<ShieldCheck className="w-4 h-4 text-canina-blue" />
|
||||
|
||||
Reference in new issue
Block a user