You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

255 lines
9.9 KiB

import React from 'react'
import { ShimmerBox, ShimmerCircle, ShimmerLine } from '@/components/shared/shimmer_frontend'
/**
* Shimmer اسکلتون استاندارد برای تب «مشخصات و متون» در پنجره جزئیات تور
* منطبق با توکن‌های AppShimmer و معماری Slate خنثی
*/
export function TourDetailOverviewShimmer() {
return (
<div className="space-y-6">
{/* بخش ۱: ترجمه پویا برای عنوان و توضیحات تور */}
<div className="rounded-2xl border border-border-soft bg-card/40 p-4 space-y-3">
<div className="flex items-center justify-between pb-1 border-b border-border-soft/60">
<div className="flex items-center gap-2">
<ShimmerCircle size={18} />
<ShimmerLine width={220} height={14} rounded="sm" />
</div>
<ShimmerLine width={80} height={12} rounded="sm" />
</div>
<div className="space-y-3 pt-1">
<div className="space-y-1.5">
<ShimmerLine width={90} height={12} rounded="sm" />
<ShimmerBox height={38} rounded="xl" className="w-full" />
</div>
<div className="space-y-1.5">
<ShimmerLine width={120} height={12} rounded="sm" />
<ShimmerBox height={96} rounded="xl" className="w-full" />
</div>
</div>
</div>
{/* بخش ۲: مشخصات عمومی و زمان‌بندی تور */}
<div className="rounded-2xl border border-border-soft bg-card/40 p-4 space-y-4">
<div className="flex items-center gap-2 pb-2 border-b border-border-soft">
<ShimmerCircle size={18} />
<ShimmerLine width={180} height={14} rounded="sm" />
</div>
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3">
{Array.from({ length: 6 }).map((_, i) => (
<div key={i} className="space-y-1.5">
<ShimmerLine width={70} height={12} rounded="sm" />
<ShimmerBox height={38} rounded="xl" className="w-full" />
</div>
))}
</div>
</div>
{/* بخش ۳: جدول ۳ ردیف نرخ‌های مصوب و تخفیف */}
<div className="rounded-2xl border border-border-soft bg-card/40 p-4 space-y-4">
<div className="flex items-center justify-between pb-2 border-b border-border-soft">
<div className="flex items-center gap-2">
<ShimmerCircle size={18} />
<ShimmerLine width={200} height={14} rounded="sm" />
</div>
<ShimmerBox width={80} height={22} rounded="md" />
</div>
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3">
{Array.from({ length: 4 }).map((_, i) => (
<div key={i} className="rounded-xl border border-border-soft bg-surface-base/50 p-3 space-y-2">
<ShimmerLine width={110} height={12} rounded="sm" />
<ShimmerBox height={34} rounded="xl" className="w-full" />
<ShimmerLine width={130} height={10} rounded="sm" />
</div>
))}
</div>
</div>
{/* بخش ۴: وضعیت تکمیل ظرفیت */}
<div className="rounded-xl border border-border-soft bg-card/20 p-4 space-y-2.5">
<div className="flex justify-between">
<ShimmerLine width={120} height={14} rounded="sm" />
<ShimmerLine width={40} height={14} rounded="sm" />
</div>
<ShimmerBox height={8} rounded="full" className="w-full" />
<div className="flex justify-between">
<ShimmerLine width={140} height={12} rounded="sm" />
<ShimmerLine width={160} height={12} rounded="sm" />
</div>
</div>
{/* بخش ۵: گالری تصاویر تور */}
<div className="space-y-2">
<ShimmerLine width={100} height={12} rounded="sm" />
<div className="flex gap-2.5 overflow-x-auto pb-2 no-scrollbar">
{Array.from({ length: 4 }).map((_, i) => (
<ShimmerBox key={i} width={96} height={96} rounded="xl" />
))}
</div>
</div>
</div>
)
}
/**
* Shimmer اسکلتون استاندارد برای تب «برنامه سفر»
*/
export function TourItineraryShimmer() {
return (
<div className="space-y-4">
{/* نوار بالایی هدر زبان */}
<div className="flex items-center justify-between bg-surface-base p-3 rounded-xl border border-border-soft">
<div className="flex items-center gap-2">
<ShimmerCircle size={18} />
<ShimmerLine width={200} height={14} rounded="sm" />
</div>
<div className="flex items-center gap-3">
<ShimmerLine width={80} height={12} rounded="sm" />
<ShimmerBox width={120} height={28} rounded="xl" />
</div>
</div>
{/* ۳ ردیف مراحل روزانه سفر */}
<div className="space-y-4">
{Array.from({ length: 3 }).map((_, i) => (
<div key={i} className="rounded-2xl border border-border-soft bg-card/40 p-4 space-y-3">
<div className="flex items-center justify-between">
<div className="flex items-center gap-2">
<ShimmerCircle size={24} />
<ShimmerLine width={130} height={14} rounded="sm" />
</div>
<ShimmerBox width={75} height={28} rounded="xl" />
</div>
<div className="space-y-2">
<ShimmerBox height={36} rounded="xl" className="w-full" />
<ShimmerBox height={56} rounded="xl" className="w-full" />
</div>
</div>
))}
</div>
</div>
)
}
/**
* Shimmer اسکلتون استاندارد برای تب «امکانات و نکات»
*/
export function TourFeaturesShimmer() {
return (
<div className="space-y-6">
<div className="flex items-center justify-between bg-surface-base p-3 rounded-xl border border-border-soft">
<div className="flex items-center gap-2">
<ShimmerCircle size={18} />
<ShimmerLine width={200} height={14} rounded="sm" />
</div>
<ShimmerBox width={120} height={28} rounded="xl" />
</div>
{/* امکانات */}
<div className="rounded-2xl border border-border-soft bg-card/40 p-4 space-y-3">
<ShimmerLine width={150} height={14} rounded="sm" />
<div className="flex flex-wrap gap-2">
{Array.from({ length: 6 }).map((_, i) => (
<ShimmerBox key={i} width={85 + (i % 3) * 15} height={28} rounded="xl" />
))}
</div>
<div className="flex items-center gap-2 pt-2">
<ShimmerBox height={36} rounded="xl" className="flex-1" />
<ShimmerBox width={75} height={36} rounded="xl" />
</div>
</div>
{/* نکات راهنما */}
<div className="rounded-2xl border border-border-soft bg-card/40 p-4 space-y-3">
<ShimmerLine width={150} height={14} rounded="sm" />
<div className="space-y-2">
{Array.from({ length: 2 }).map((_, i) => (
<div key={i} className="rounded-xl border border-border-soft bg-surface-base/50 p-3 space-y-1.5">
<ShimmerLine width={130} height={14} rounded="sm" />
<ShimmerLine width="90%" height={12} rounded="sm" />
</div>
))}
</div>
</div>
</div>
)
}
/**
* Shimmer اسکلتون استاندارد برای تب «مسافران»
*/
export function TourPassengersShimmer() {
return (
<div className="space-y-3">
{Array.from({ length: 2 }).map((_, i) => (
<div key={i} className="rounded-2xl border border-border-soft bg-card/40 p-4 space-y-3">
<div className="flex items-center justify-between border-b border-border-soft pb-2">
<ShimmerLine width={140} height={14} rounded="sm" />
<ShimmerLine width={60} height={12} rounded="sm" />
</div>
<div className="grid grid-cols-1 sm:grid-cols-2 gap-2.5">
{Array.from({ length: 2 }).map((_, j) => (
<div key={j} className="rounded-xl border border-border-soft bg-surface-base/50 p-3 space-y-2">
<ShimmerLine width={120} height={14} rounded="sm" />
<div className="flex justify-between">
<ShimmerLine width={90} height={10} rounded="sm" />
<ShimmerLine width={70} height={10} rounded="sm" />
</div>
</div>
))}
</div>
</div>
))}
</div>
)
}
/**
* Shimmer اسکلتون استاندارد برای تب «نظرات»
*/
export function TourCommentsShimmer() {
return (
<div className="space-y-3">
{Array.from({ length: 3 }).map((_, i) => (
<div key={i} className="rounded-2xl border border-border-soft bg-card/40 p-4 space-y-2">
<div className="flex items-center justify-between">
<div className="flex items-center gap-2">
<ShimmerCircle size={24} />
<ShimmerLine width={100} height={14} rounded="sm" />
</div>
<ShimmerLine width={40} height={12} rounded="sm" />
</div>
<ShimmerLine width="95%" height={12} rounded="sm" />
<ShimmerLine width="60%" height={12} rounded="sm" />
</div>
))}
</div>
)
}
interface TourDetailModalShimmerProps {
activeTab?: 'overview' | 'itinerary' | 'features' | 'hotels' | 'transport' | 'passengers' | 'comments'
}
/**
* رندرر هوشمند و جامع Shimmer متناسب با تب فعال در پنجره جزئیات تور
*/
export function TourDetailModalShimmer({ activeTab = 'overview' }: TourDetailModalShimmerProps) {
switch (activeTab) {
case 'itinerary':
return <TourItineraryShimmer />
case 'features':
return <TourFeaturesShimmer />
case 'passengers':
return <TourPassengersShimmer />
case 'comments':
return <TourCommentsShimmer />
case 'overview':
default:
return <TourDetailOverviewShimmer />
}
}