refactor(alert-settings): integrate AppShell layout and update cache version
Some checks failed
Deploy MyApp on Same Server / build-and-deploy (push) Has been cancelled

- Replace custom page layout with AppShell component for consistent UI
- Remove unused PageHeader and UpdateAlertConditionDto imports
- Update service worker cache names and version.json to new timestamp
This commit is contained in:
2026-05-11 22:19:30 +03:30
parent 676f1373c1
commit 9da69c96b1
20 changed files with 1025 additions and 172 deletions

View File

@@ -6,14 +6,14 @@ import { persianToGregorian, getCurrentPersianDay, getCurrentPersianYear, getCur
import { formatPersianDate, ensureDateFormat } from '@/lib/format/persian-date'
import { TABS, TabType } from '@/features/daily-report'
import { detectDataGaps } from '@/features/daily-report/utils'
import { BarChart3, Bell, CalendarIcon, ChevronRight } from 'lucide-react'
import Link from 'next/link'
import { BarChart3, CalendarIcon, ChevronRight } from 'lucide-react'
import Loading from '@/components/Loading'
import { SummaryTab } from '@/components/daily-report'
import { fetchForecastWeather, isToday as checkIsToday, WeatherData } from '@/features/weather'
import { Tabs, PageHeader, Button } from '@/components/common'
import { Tabs, Button } from '@/components/common'
import { DateNavigation } from '@/components/navigation'
import { usePullToRefresh } from '@/hooks/usePullToRefresh'
import { AppShell } from '@/components/layout'
// Lazy load heavy components
const ChartsTab = lazy(() => import('@/components/daily-report/ChartsTab').then(m => ({ default: m.ChartsTab })))
@@ -201,50 +201,43 @@ function DailyReportContent() {
if (!selectedDate) {
return (
<div className="min-h-screen flex items-center justify-center p-4">
<div className="text-center">
<CalendarIcon className="w-12 h-12 text-red-500 mx-auto mb-4" />
<div className="text-lg text-red-600 mb-4">تاریخ انتخاب نشده است</div>
<Button
onClick={goToCalendar}
variant="outline"
icon={ChevronRight}
>
بازگشت به تقویم
</Button>
<AppShell
pageTitle="گزارش روزانه"
pageIcon={BarChart3}
iconGradient="from-indigo-500 to-purple-600"
>
<div className="flex items-center justify-center p-4">
<div className="text-center">
<CalendarIcon className="w-12 h-12 text-red-500 mx-auto mb-4" />
<div className="text-lg text-red-600 mb-4">تاریخ انتخاب نشده است</div>
<Button
onClick={goToCalendar}
variant="outline"
icon={ChevronRight}
>
بازگشت به تقویم
</Button>
</div>
</div>
</div>
</AppShell>
)
}
return (
<div className="min-h-screen p-4 md:p-6">
<div className="max-w-7xl mx-auto space-y-6">
{/* Header */}
<PageHeader
icon={BarChart3}
title="گزارش روزانه"
iconGradient="from-indigo-500 to-purple-600"
action={
<Link
href={`/alert-settings?deviceId=${deviceId}`}
className="flex items-center gap-2 px-4 py-2.5 bg-white border-2 border-orange-300 hover:border-orange-500 hover:bg-orange-50 text-orange-700 hover:text-orange-800 rounded-xl transition-all duration-200 font-medium shadow-sm hover:shadow-md"
>
<Bell className="w-5 h-5" />
<span className="hidden sm:inline">تنظیمات هشدار</span>
</Link>
}
/>
<AppShell
pageTitle="گزارش روزانه"
pageIcon={BarChart3}
pageInfo={selectedDate}
iconGradient="from-indigo-500 to-purple-600"
>
<div className="space-y-6">
{/* Date Navigation Buttons */}
{selectedDate && (
<DateNavigation
selectedDate={selectedDate}
onPrevious={goToPreviousDay}
onNext={goToNextDay}
onCalendar={goToCalendar}
/>
)}
<DateNavigation
selectedDate={selectedDate}
onPrevious={goToPreviousDay}
onNext={goToNextDay}
onCalendar={goToCalendar}
/>
{/* Tabs */}
<Tabs
@@ -273,7 +266,7 @@ function DailyReportContent() {
}}
</Tabs>
</div>
</div>
</AppShell>
)
}