fix: replace emojis with MUI icons and use theme colors in dashboard (refs #2)
All checks were successful
Deploy to Staging / Build Images (pull_request) Successful in 2m39s
Deploy to Staging / Deploy to Staging (pull_request) Successful in 37s
Deploy to Staging / Verify Staging (pull_request) Successful in 6s
Deploy to Staging / Notify Staging Ready (pull_request) Successful in 5s
Deploy to Staging / Notify Staging Failure (pull_request) Has been skipped
All checks were successful
Deploy to Staging / Build Images (pull_request) Successful in 2m39s
Deploy to Staging / Deploy to Staging (pull_request) Successful in 37s
Deploy to Staging / Verify Staging (pull_request) Successful in 6s
Deploy to Staging / Notify Staging Ready (pull_request) Successful in 5s
Deploy to Staging / Notify Staging Failure (pull_request) Has been skipped
Visual consistency fixes: - Replace all emojis with MUI Rounded icons - Use theme colors (primary.main, warning.main, success.main, error.main) - Use MUI Box with sx prop for consistent styling - Use shared Button component instead of custom styled buttons - Use theme tokens for dark mode (avus, titanio, canna) Components updated: - SummaryCards: DirectionsCarRoundedIcon, BuildRoundedIcon, LocalGasStationRoundedIcon - QuickActions: MUI icons with primary.main color - VehicleAttention: ErrorRoundedIcon, WarningAmberRoundedIcon, ScheduleRoundedIcon - DashboardScreen: Proper icons for error/empty states, shared Button component 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,11 +3,15 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { Box } from '@mui/material';
|
||||||
|
import WarningAmberRoundedIcon from '@mui/icons-material/WarningAmberRounded';
|
||||||
|
import DirectionsCarRoundedIcon from '@mui/icons-material/DirectionsCarRounded';
|
||||||
import { SummaryCards, SummaryCardsSkeleton } from './SummaryCards';
|
import { SummaryCards, SummaryCardsSkeleton } from './SummaryCards';
|
||||||
import { VehicleAttention, VehicleAttentionSkeleton } from './VehicleAttention';
|
import { VehicleAttention, VehicleAttentionSkeleton } from './VehicleAttention';
|
||||||
import { QuickActions, QuickActionsSkeleton } from './QuickActions';
|
import { QuickActions, QuickActionsSkeleton } from './QuickActions';
|
||||||
import { useDashboardSummary, useVehiclesNeedingAttention } from '../hooks/useDashboardData';
|
import { useDashboardSummary, useVehiclesNeedingAttention } from '../hooks/useDashboardData';
|
||||||
import { GlassCard } from '../../../shared-minimal/components/mobile/GlassCard';
|
import { GlassCard } from '../../../shared-minimal/components/mobile/GlassCard';
|
||||||
|
import { Button } from '../../../shared-minimal/components/Button';
|
||||||
|
|
||||||
import { MobileScreen } from '../../../core/store';
|
import { MobileScreen } from '../../../core/store';
|
||||||
import { Vehicle } from '../../vehicles/types/vehicles.types';
|
import { Vehicle } from '../../vehicles/types/vehicles.types';
|
||||||
@@ -30,20 +34,22 @@ export const DashboardScreen: React.FC<DashboardScreenProps> = ({
|
|||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
<GlassCard>
|
<GlassCard>
|
||||||
<div className="text-center py-12">
|
<div className="text-center py-12">
|
||||||
<div className="text-4xl mb-3">⚠️</div>
|
<Box sx={{ color: 'warning.main', mb: 1.5 }}>
|
||||||
<h2 className="text-lg font-semibold text-slate-800 dark:text-slate-200 mb-2">
|
<WarningAmberRoundedIcon sx={{ fontSize: 48 }} />
|
||||||
|
</Box>
|
||||||
|
<h2 className="text-lg font-semibold text-slate-800 dark:text-avus mb-2">
|
||||||
Unable to Load Dashboard
|
Unable to Load Dashboard
|
||||||
</h2>
|
</h2>
|
||||||
<p className="text-slate-500 dark:text-slate-400 mb-4">
|
<p className="text-slate-500 dark:text-titanio mb-4">
|
||||||
There was an error loading your dashboard data
|
There was an error loading your dashboard data
|
||||||
</p>
|
</p>
|
||||||
<button
|
<Button
|
||||||
|
variant="primary"
|
||||||
|
size="md"
|
||||||
onClick={() => window.location.reload()}
|
onClick={() => window.location.reload()}
|
||||||
className="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors"
|
|
||||||
style={{ minHeight: '44px' }} // Touch target size
|
|
||||||
>
|
>
|
||||||
Retry
|
Retry
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</GlassCard>
|
</GlassCard>
|
||||||
</div>
|
</div>
|
||||||
@@ -67,20 +73,22 @@ export const DashboardScreen: React.FC<DashboardScreenProps> = ({
|
|||||||
<div className="space-y-6">
|
<div className="space-y-6">
|
||||||
<GlassCard>
|
<GlassCard>
|
||||||
<div className="text-center py-12">
|
<div className="text-center py-12">
|
||||||
<div className="text-6xl mb-4">🚗</div>
|
<Box sx={{ color: 'primary.main', mb: 2 }}>
|
||||||
<h2 className="text-xl font-semibold text-slate-800 dark:text-slate-200 mb-3">
|
<DirectionsCarRoundedIcon sx={{ fontSize: 64 }} />
|
||||||
|
</Box>
|
||||||
|
<h2 className="text-xl font-semibold text-slate-800 dark:text-avus mb-3">
|
||||||
Welcome to MotoVaultPro
|
Welcome to MotoVaultPro
|
||||||
</h2>
|
</h2>
|
||||||
<p className="text-slate-500 dark:text-slate-400 mb-6 max-w-md mx-auto">
|
<p className="text-slate-500 dark:text-titanio mb-6 max-w-md mx-auto">
|
||||||
Get started by adding your first vehicle to track fuel logs, maintenance, and more
|
Get started by adding your first vehicle to track fuel logs, maintenance, and more
|
||||||
</p>
|
</p>
|
||||||
<button
|
<Button
|
||||||
|
variant="primary"
|
||||||
|
size="lg"
|
||||||
onClick={() => onNavigate?.('Vehicles')}
|
onClick={() => onNavigate?.('Vehicles')}
|
||||||
className="px-6 py-3 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors font-medium"
|
|
||||||
style={{ minHeight: '44px' }} // Touch target size
|
|
||||||
>
|
>
|
||||||
Add Your First Vehicle
|
Add Your First Vehicle
|
||||||
</button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</GlassCard>
|
</GlassCard>
|
||||||
</div>
|
</div>
|
||||||
@@ -116,7 +124,7 @@ export const DashboardScreen: React.FC<DashboardScreenProps> = ({
|
|||||||
|
|
||||||
{/* Footer Hint */}
|
{/* Footer Hint */}
|
||||||
<div className="text-center py-4">
|
<div className="text-center py-4">
|
||||||
<p className="text-xs text-slate-400 dark:text-slate-500">
|
<p className="text-xs text-slate-400 dark:text-canna">
|
||||||
Dashboard updates every 2 minutes
|
Dashboard updates every 2 minutes
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,15 +3,18 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { Box, SvgIconProps } from '@mui/material';
|
||||||
|
import DirectionsCarRoundedIcon from '@mui/icons-material/DirectionsCarRounded';
|
||||||
|
import LocalGasStationRoundedIcon from '@mui/icons-material/LocalGasStationRounded';
|
||||||
|
import BuildRoundedIcon from '@mui/icons-material/BuildRounded';
|
||||||
|
import FormatListBulletedRoundedIcon from '@mui/icons-material/FormatListBulletedRounded';
|
||||||
import { GlassCard } from '../../../shared-minimal/components/mobile/GlassCard';
|
import { GlassCard } from '../../../shared-minimal/components/mobile/GlassCard';
|
||||||
|
|
||||||
interface QuickAction {
|
interface QuickAction {
|
||||||
id: string;
|
id: string;
|
||||||
title: string;
|
title: string;
|
||||||
description: string;
|
description: string;
|
||||||
icon: string;
|
icon: React.ComponentType<SvgIconProps>;
|
||||||
color: string;
|
|
||||||
bgColor: string;
|
|
||||||
onClick: () => void;
|
onClick: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -33,36 +36,28 @@ export const QuickActions: React.FC<QuickActionsProps> = ({
|
|||||||
id: 'add-vehicle',
|
id: 'add-vehicle',
|
||||||
title: 'Add Vehicle',
|
title: 'Add Vehicle',
|
||||||
description: 'Register a new vehicle',
|
description: 'Register a new vehicle',
|
||||||
icon: '🚗',
|
icon: DirectionsCarRoundedIcon,
|
||||||
color: 'text-blue-600',
|
|
||||||
bgColor: 'bg-blue-50',
|
|
||||||
onClick: onAddVehicle,
|
onClick: onAddVehicle,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'log-fuel',
|
id: 'log-fuel',
|
||||||
title: 'Log Fuel',
|
title: 'Log Fuel',
|
||||||
description: 'Record a fuel purchase',
|
description: 'Record a fuel purchase',
|
||||||
icon: '⛽',
|
icon: LocalGasStationRoundedIcon,
|
||||||
color: 'text-green-600',
|
|
||||||
bgColor: 'bg-green-50',
|
|
||||||
onClick: onLogFuel,
|
onClick: onLogFuel,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'view-maintenance',
|
id: 'view-maintenance',
|
||||||
title: 'Maintenance',
|
title: 'Maintenance',
|
||||||
description: 'View maintenance records',
|
description: 'View maintenance records',
|
||||||
icon: '🔧',
|
icon: BuildRoundedIcon,
|
||||||
color: 'text-orange-600',
|
|
||||||
bgColor: 'bg-orange-50',
|
|
||||||
onClick: onViewMaintenance,
|
onClick: onViewMaintenance,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'view-vehicles',
|
id: 'view-vehicles',
|
||||||
title: 'My Vehicles',
|
title: 'My Vehicles',
|
||||||
description: 'View all vehicles',
|
description: 'View all vehicles',
|
||||||
icon: '📋',
|
icon: FormatListBulletedRoundedIcon,
|
||||||
color: 'text-purple-600',
|
|
||||||
bgColor: 'bg-purple-50',
|
|
||||||
onClick: onViewVehicles,
|
onClick: onViewVehicles,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@@ -70,33 +65,79 @@ export const QuickActions: React.FC<QuickActionsProps> = ({
|
|||||||
return (
|
return (
|
||||||
<GlassCard padding="md">
|
<GlassCard padding="md">
|
||||||
<div className="mb-4">
|
<div className="mb-4">
|
||||||
<h3 className="text-lg font-semibold text-slate-800 dark:text-slate-200">
|
<h3 className="text-lg font-semibold text-slate-800 dark:text-avus">
|
||||||
Quick Actions
|
Quick Actions
|
||||||
</h3>
|
</h3>
|
||||||
<p className="text-sm text-slate-500 dark:text-slate-400">
|
<p className="text-sm text-slate-500 dark:text-titanio">
|
||||||
Common tasks and navigation
|
Common tasks and navigation
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="grid grid-cols-2 sm:grid-cols-4 gap-3">
|
<div className="grid grid-cols-2 sm:grid-cols-4 gap-3">
|
||||||
{actions.map((action) => (
|
{actions.map((action) => {
|
||||||
<button
|
const IconComponent = action.icon;
|
||||||
key={action.id}
|
return (
|
||||||
onClick={action.onClick}
|
<Box
|
||||||
className={`p-4 rounded-2xl ${action.bgColor} dark:bg-opacity-10 border border-transparent hover:border-slate-200 dark:hover:border-slate-700 hover:shadow-md transition-all duration-200 text-left min-h-[100px] sm:min-h-[120px] flex flex-col`}
|
key={action.id}
|
||||||
style={{ minHeight: '44px' }} // Ensure touch target size
|
component="button"
|
||||||
>
|
onClick={action.onClick}
|
||||||
<div className="text-3xl mb-2">{action.icon}</div>
|
sx={{
|
||||||
<div className="flex-1">
|
p: 2,
|
||||||
<h4 className={`font-semibold ${action.color} dark:opacity-90 text-sm mb-1`}>
|
borderRadius: 3,
|
||||||
{action.title}
|
bgcolor: 'action.hover',
|
||||||
</h4>
|
border: '1px solid transparent',
|
||||||
<p className="text-xs text-slate-500 dark:text-slate-400 hidden sm:block">
|
display: 'flex',
|
||||||
{action.description}
|
flexDirection: 'column',
|
||||||
</p>
|
alignItems: 'flex-start',
|
||||||
</div>
|
textAlign: 'left',
|
||||||
</button>
|
minHeight: { xs: 100, sm: 120 },
|
||||||
))}
|
transition: 'all 0.2s',
|
||||||
|
cursor: 'pointer',
|
||||||
|
'&:hover': {
|
||||||
|
bgcolor: 'action.selected',
|
||||||
|
borderColor: 'divider',
|
||||||
|
},
|
||||||
|
'&:focus': {
|
||||||
|
outline: 'none',
|
||||||
|
borderColor: 'primary.main',
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Box
|
||||||
|
sx={{
|
||||||
|
color: 'primary.main',
|
||||||
|
mb: 1.5,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<IconComponent sx={{ fontSize: 28 }} />
|
||||||
|
</Box>
|
||||||
|
<Box sx={{ flex: 1 }}>
|
||||||
|
<Box
|
||||||
|
component="span"
|
||||||
|
sx={{
|
||||||
|
display: 'block',
|
||||||
|
fontWeight: 600,
|
||||||
|
fontSize: '0.875rem',
|
||||||
|
color: 'text.primary',
|
||||||
|
mb: 0.5,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{action.title}
|
||||||
|
</Box>
|
||||||
|
<Box
|
||||||
|
component="span"
|
||||||
|
sx={{
|
||||||
|
display: { xs: 'none', sm: 'block' },
|
||||||
|
fontSize: '0.75rem',
|
||||||
|
color: 'text.secondary',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{action.description}
|
||||||
|
</Box>
|
||||||
|
</Box>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
})}
|
||||||
</div>
|
</div>
|
||||||
</GlassCard>
|
</GlassCard>
|
||||||
);
|
);
|
||||||
@@ -113,9 +154,9 @@ export const QuickActionsSkeleton: React.FC = () => {
|
|||||||
{[1, 2, 3, 4].map((i) => (
|
{[1, 2, 3, 4].map((i) => (
|
||||||
<div
|
<div
|
||||||
key={i}
|
key={i}
|
||||||
className="p-4 rounded-2xl bg-slate-50 dark:bg-slate-800 min-h-[100px] sm:min-h-[120px]"
|
className="p-4 rounded-xl bg-slate-50 dark:bg-slate-800 min-h-[100px] sm:min-h-[120px]"
|
||||||
>
|
>
|
||||||
<div className="w-8 h-8 bg-slate-100 dark:bg-slate-700 rounded animate-pulse mb-2" />
|
<div className="w-7 h-7 bg-slate-100 dark:bg-slate-700 rounded animate-pulse mb-3" />
|
||||||
<div className="h-4 bg-slate-100 dark:bg-slate-700 rounded animate-pulse w-20 mb-2" />
|
<div className="h-4 bg-slate-100 dark:bg-slate-700 rounded animate-pulse w-20 mb-2" />
|
||||||
<div className="h-3 bg-slate-100 dark:bg-slate-700 rounded animate-pulse w-full hidden sm:block" />
|
<div className="h-3 bg-slate-100 dark:bg-slate-700 rounded animate-pulse w-full hidden sm:block" />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { Box } from '@mui/material';
|
||||||
|
import DirectionsCarRoundedIcon from '@mui/icons-material/DirectionsCarRounded';
|
||||||
|
import BuildRoundedIcon from '@mui/icons-material/BuildRounded';
|
||||||
|
import LocalGasStationRoundedIcon from '@mui/icons-material/LocalGasStationRounded';
|
||||||
import { GlassCard } from '../../../shared-minimal/components/mobile/GlassCard';
|
import { GlassCard } from '../../../shared-minimal/components/mobile/GlassCard';
|
||||||
import { DashboardSummary } from '../types';
|
import { DashboardSummary } from '../types';
|
||||||
|
|
||||||
@@ -15,52 +19,71 @@ export const SummaryCards: React.FC<SummaryCardsProps> = ({ summary }) => {
|
|||||||
{
|
{
|
||||||
title: 'Total Vehicles',
|
title: 'Total Vehicles',
|
||||||
value: summary.totalVehicles,
|
value: summary.totalVehicles,
|
||||||
icon: '🚗',
|
icon: DirectionsCarRoundedIcon,
|
||||||
color: 'text-blue-600',
|
color: 'primary.main',
|
||||||
bgColor: 'bg-blue-50',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Upcoming Maintenance',
|
title: 'Upcoming Maintenance',
|
||||||
value: summary.upcomingMaintenanceCount,
|
value: summary.upcomingMaintenanceCount,
|
||||||
subtitle: 'Next 30 days',
|
subtitle: 'Next 30 days',
|
||||||
icon: '🔧',
|
icon: BuildRoundedIcon,
|
||||||
color: 'text-orange-600',
|
color: 'warning.main',
|
||||||
bgColor: 'bg-orange-50',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Recent Fuel Logs',
|
title: 'Recent Fuel Logs',
|
||||||
value: summary.recentFuelLogsCount,
|
value: summary.recentFuelLogsCount,
|
||||||
subtitle: 'Last 7 days',
|
subtitle: 'Last 7 days',
|
||||||
icon: '⛽',
|
icon: LocalGasStationRoundedIcon,
|
||||||
color: 'text-green-600',
|
color: 'success.main',
|
||||||
bgColor: 'bg-green-50',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
|
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||||
{cards.map((card) => (
|
{cards.map((card) => {
|
||||||
<GlassCard key={card.title} padding="md">
|
const IconComponent = card.icon;
|
||||||
<div className="flex items-start gap-3">
|
return (
|
||||||
<div className={`flex-shrink-0 w-12 h-12 rounded-2xl ${card.bgColor} flex items-center justify-center text-2xl`}>
|
<GlassCard key={card.title} padding="md">
|
||||||
{card.icon}
|
<div className="flex items-start gap-3">
|
||||||
</div>
|
<Box
|
||||||
<div className="flex-1 min-w-0">
|
sx={{
|
||||||
<p className="text-sm text-slate-500 dark:text-slate-400 font-medium mb-1">
|
flexShrink: 0,
|
||||||
{card.title}
|
width: 48,
|
||||||
</p>
|
height: 48,
|
||||||
<p className={`text-3xl font-bold ${card.color} dark:opacity-90`}>
|
borderRadius: 3,
|
||||||
{card.value}
|
display: 'flex',
|
||||||
</p>
|
alignItems: 'center',
|
||||||
{card.subtitle && (
|
justifyContent: 'center',
|
||||||
<p className="text-xs text-slate-400 dark:text-slate-500 mt-1">
|
bgcolor: 'action.hover',
|
||||||
{card.subtitle}
|
}}
|
||||||
|
>
|
||||||
|
<IconComponent sx={{ fontSize: 24, color: card.color }} />
|
||||||
|
</Box>
|
||||||
|
<div className="flex-1 min-w-0">
|
||||||
|
<p className="text-sm text-slate-500 dark:text-titanio font-medium mb-1">
|
||||||
|
{card.title}
|
||||||
</p>
|
</p>
|
||||||
)}
|
<Box
|
||||||
|
component="p"
|
||||||
|
sx={{
|
||||||
|
fontSize: '1.875rem',
|
||||||
|
fontWeight: 700,
|
||||||
|
color: 'text.primary',
|
||||||
|
lineHeight: 1.2,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{card.value}
|
||||||
|
</Box>
|
||||||
|
{card.subtitle && (
|
||||||
|
<p className="text-xs text-slate-400 dark:text-canna mt-1">
|
||||||
|
{card.subtitle}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</GlassCard>
|
||||||
</GlassCard>
|
);
|
||||||
))}
|
})}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -71,7 +94,7 @@ export const SummaryCardsSkeleton: React.FC = () => {
|
|||||||
{[1, 2, 3].map((i) => (
|
{[1, 2, 3].map((i) => (
|
||||||
<GlassCard key={i} padding="md">
|
<GlassCard key={i} padding="md">
|
||||||
<div className="flex items-start gap-3">
|
<div className="flex items-start gap-3">
|
||||||
<div className="flex-shrink-0 w-12 h-12 rounded-2xl bg-slate-100 dark:bg-slate-800 animate-pulse" />
|
<div className="flex-shrink-0 w-12 h-12 rounded-xl bg-slate-100 dark:bg-slate-800 animate-pulse" />
|
||||||
<div className="flex-1 min-w-0 space-y-2">
|
<div className="flex-1 min-w-0 space-y-2">
|
||||||
<div className="h-4 bg-slate-100 dark:bg-slate-800 rounded animate-pulse w-24" />
|
<div className="h-4 bg-slate-100 dark:bg-slate-800 rounded animate-pulse w-24" />
|
||||||
<div className="h-8 bg-slate-100 dark:bg-slate-800 rounded animate-pulse w-16" />
|
<div className="h-8 bg-slate-100 dark:bg-slate-800 rounded animate-pulse w-16" />
|
||||||
|
|||||||
@@ -3,6 +3,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { Box, SvgIconProps } from '@mui/material';
|
||||||
|
import CheckCircleRoundedIcon from '@mui/icons-material/CheckCircleRounded';
|
||||||
|
import ErrorRoundedIcon from '@mui/icons-material/ErrorRounded';
|
||||||
|
import WarningAmberRoundedIcon from '@mui/icons-material/WarningAmberRounded';
|
||||||
|
import ScheduleRoundedIcon from '@mui/icons-material/ScheduleRounded';
|
||||||
import { GlassCard } from '../../../shared-minimal/components/mobile/GlassCard';
|
import { GlassCard } from '../../../shared-minimal/components/mobile/GlassCard';
|
||||||
import { VehicleNeedingAttention } from '../types';
|
import { VehicleNeedingAttention } from '../types';
|
||||||
|
|
||||||
@@ -16,11 +21,13 @@ export const VehicleAttention: React.FC<VehicleAttentionProps> = ({ vehicles, on
|
|||||||
return (
|
return (
|
||||||
<GlassCard padding="md">
|
<GlassCard padding="md">
|
||||||
<div className="text-center py-8">
|
<div className="text-center py-8">
|
||||||
<div className="text-4xl mb-3">✅</div>
|
<Box sx={{ color: 'success.main', mb: 1.5 }}>
|
||||||
<h3 className="text-lg font-semibold text-slate-800 dark:text-slate-200 mb-2">
|
<CheckCircleRoundedIcon sx={{ fontSize: 48 }} />
|
||||||
|
</Box>
|
||||||
|
<h3 className="text-lg font-semibold text-slate-800 dark:text-avus mb-2">
|
||||||
All Caught Up!
|
All Caught Up!
|
||||||
</h3>
|
</h3>
|
||||||
<p className="text-sm text-slate-500 dark:text-slate-400">
|
<p className="text-sm text-slate-500 dark:text-titanio">
|
||||||
No vehicles need immediate attention
|
No vehicles need immediate attention
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -28,34 +35,28 @@ export const VehicleAttention: React.FC<VehicleAttentionProps> = ({ vehicles, on
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const priorityConfig = {
|
const priorityConfig: Record<string, { color: string; icon: React.ComponentType<SvgIconProps> }> = {
|
||||||
high: {
|
high: {
|
||||||
color: 'text-red-600',
|
color: 'error.main',
|
||||||
bgColor: 'bg-red-50',
|
icon: ErrorRoundedIcon,
|
||||||
borderColor: 'border-red-200',
|
|
||||||
icon: '🚨',
|
|
||||||
},
|
},
|
||||||
medium: {
|
medium: {
|
||||||
color: 'text-orange-600',
|
color: 'warning.main',
|
||||||
bgColor: 'bg-orange-50',
|
icon: WarningAmberRoundedIcon,
|
||||||
borderColor: 'border-orange-200',
|
|
||||||
icon: '⚠️',
|
|
||||||
},
|
},
|
||||||
low: {
|
low: {
|
||||||
color: 'text-yellow-600',
|
color: 'info.main',
|
||||||
bgColor: 'bg-yellow-50',
|
icon: ScheduleRoundedIcon,
|
||||||
borderColor: 'border-yellow-200',
|
|
||||||
icon: '⏰',
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<GlassCard padding="md">
|
<GlassCard padding="md">
|
||||||
<div className="mb-4">
|
<div className="mb-4">
|
||||||
<h3 className="text-lg font-semibold text-slate-800 dark:text-slate-200">
|
<h3 className="text-lg font-semibold text-slate-800 dark:text-avus">
|
||||||
Needs Attention
|
Needs Attention
|
||||||
</h3>
|
</h3>
|
||||||
<p className="text-sm text-slate-500 dark:text-slate-400">
|
<p className="text-sm text-slate-500 dark:text-titanio">
|
||||||
Vehicles with overdue maintenance
|
Vehicles with overdue maintenance
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -63,41 +64,70 @@ export const VehicleAttention: React.FC<VehicleAttentionProps> = ({ vehicles, on
|
|||||||
<div className="space-y-3">
|
<div className="space-y-3">
|
||||||
{vehicles.map((vehicle) => {
|
{vehicles.map((vehicle) => {
|
||||||
const config = priorityConfig[vehicle.priority];
|
const config = priorityConfig[vehicle.priority];
|
||||||
|
const IconComponent = config.icon;
|
||||||
return (
|
return (
|
||||||
<div
|
<Box
|
||||||
key={vehicle.id}
|
key={vehicle.id}
|
||||||
className={`p-4 rounded-2xl border ${config.borderColor} ${config.bgColor} dark:bg-opacity-10 ${
|
|
||||||
onVehicleClick ? 'cursor-pointer hover:shadow-md transition-shadow' : ''
|
|
||||||
}`}
|
|
||||||
onClick={() => onVehicleClick?.(vehicle.id)}
|
onClick={() => onVehicleClick?.(vehicle.id)}
|
||||||
role={onVehicleClick ? 'button' : undefined}
|
role={onVehicleClick ? 'button' : undefined}
|
||||||
tabIndex={onVehicleClick ? 0 : undefined}
|
tabIndex={onVehicleClick ? 0 : undefined}
|
||||||
onKeyDown={(e) => {
|
onKeyDown={(e: React.KeyboardEvent) => {
|
||||||
if (onVehicleClick && (e.key === 'Enter' || e.key === ' ')) {
|
if (onVehicleClick && (e.key === 'Enter' || e.key === ' ')) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
onVehicleClick(vehicle.id);
|
onVehicleClick(vehicle.id);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
sx={{
|
||||||
|
p: 2,
|
||||||
|
borderRadius: 3,
|
||||||
|
bgcolor: 'action.hover',
|
||||||
|
border: '1px solid',
|
||||||
|
borderColor: 'divider',
|
||||||
|
cursor: onVehicleClick ? 'pointer' : 'default',
|
||||||
|
transition: 'all 0.2s',
|
||||||
|
'&:hover': onVehicleClick ? {
|
||||||
|
bgcolor: 'action.selected',
|
||||||
|
} : {},
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<div className="flex items-start gap-3">
|
<div className="flex items-start gap-3">
|
||||||
<div className="flex-shrink-0 text-2xl">
|
<Box sx={{ flexShrink: 0, color: config.color }}>
|
||||||
{config.icon}
|
<IconComponent sx={{ fontSize: 24 }} />
|
||||||
</div>
|
</Box>
|
||||||
<div className="flex-1 min-w-0">
|
<div className="flex-1 min-w-0">
|
||||||
<h4 className={`font-semibold ${config.color} dark:opacity-90 text-base mb-1`}>
|
<Box
|
||||||
|
component="h4"
|
||||||
|
sx={{
|
||||||
|
fontWeight: 600,
|
||||||
|
color: 'text.primary',
|
||||||
|
fontSize: '1rem',
|
||||||
|
mb: 0.5,
|
||||||
|
}}
|
||||||
|
>
|
||||||
{vehicle.nickname || `${vehicle.year} ${vehicle.make} ${vehicle.model}`}
|
{vehicle.nickname || `${vehicle.year} ${vehicle.make} ${vehicle.model}`}
|
||||||
</h4>
|
</Box>
|
||||||
<p className="text-sm text-slate-600 dark:text-slate-400">
|
<p className="text-sm text-slate-600 dark:text-titanio">
|
||||||
{vehicle.reason}
|
{vehicle.reason}
|
||||||
</p>
|
</p>
|
||||||
<div className="flex items-center gap-2 mt-2">
|
<Box
|
||||||
<span className={`text-xs font-medium px-2 py-1 rounded-full ${config.bgColor} ${config.color} dark:bg-opacity-20`}>
|
component="span"
|
||||||
{vehicle.priority.toUpperCase()} PRIORITY
|
sx={{
|
||||||
</span>
|
display: 'inline-block',
|
||||||
</div>
|
mt: 1,
|
||||||
|
px: 1.5,
|
||||||
|
py: 0.5,
|
||||||
|
borderRadius: 2,
|
||||||
|
fontSize: '0.75rem',
|
||||||
|
fontWeight: 500,
|
||||||
|
bgcolor: 'action.selected',
|
||||||
|
color: config.color,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{vehicle.priority.toUpperCase()} PRIORITY
|
||||||
|
</Box>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</Box>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
@@ -114,7 +144,7 @@ export const VehicleAttentionSkeleton: React.FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="space-y-3">
|
<div className="space-y-3">
|
||||||
{[1, 2].map((i) => (
|
{[1, 2].map((i) => (
|
||||||
<div key={i} className="p-4 rounded-2xl bg-slate-50 dark:bg-slate-800">
|
<div key={i} className="p-4 rounded-xl bg-slate-50 dark:bg-slate-800">
|
||||||
<div className="flex items-start gap-3">
|
<div className="flex items-start gap-3">
|
||||||
<div className="flex-shrink-0 w-6 h-6 bg-slate-100 dark:bg-slate-700 rounded animate-pulse" />
|
<div className="flex-shrink-0 w-6 h-6 bg-slate-100 dark:bg-slate-700 rounded animate-pulse" />
|
||||||
<div className="flex-1 space-y-2">
|
<div className="flex-1 space-y-2">
|
||||||
|
|||||||
Reference in New Issue
Block a user