2026-05-24 19:51:29 +00:00
|
|
|
'use client';
|
|
|
|
|
|
|
|
|
|
import { useState } from 'react';
|
2026-05-24 22:47:47 +00:00
|
|
|
import { OrderItem } from '@/lib/types';
|
2026-05-24 20:31:35 +00:00
|
|
|
import { cn, formatDate, formatCurrency, parseCoordinates } from '@/lib/utils';
|
2026-05-24 19:51:29 +00:00
|
|
|
import {
|
|
|
|
|
Check,
|
|
|
|
|
AlertTriangle,
|
|
|
|
|
Navigation,
|
|
|
|
|
ChevronDown,
|
|
|
|
|
ChevronUp,
|
|
|
|
|
Package,
|
|
|
|
|
Wrench,
|
|
|
|
|
Hammer,
|
|
|
|
|
ShoppingCart,
|
|
|
|
|
AlertCircle,
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
Clock,
|
|
|
|
|
MapPin,
|
2026-05-24 19:51:29 +00:00
|
|
|
} from 'lucide-react';
|
|
|
|
|
|
|
|
|
|
interface CollectionItemProps {
|
2026-05-24 22:47:47 +00:00
|
|
|
item: OrderItem;
|
2026-05-26 22:55:21 +00:00
|
|
|
supplierColor?: { border: string; dot: string; light: string; text: string; ring: string };
|
|
|
|
|
compact?: boolean;
|
2026-05-24 22:47:47 +00:00
|
|
|
onCollect: (item: OrderItem) => void;
|
|
|
|
|
onProblem: (item: OrderItem) => void;
|
2026-05-24 19:51:29 +00:00
|
|
|
onNavigate: (lat: number, lng: number, name: string) => void;
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-24 22:47:47 +00:00
|
|
|
function getItemType(item: OrderItem): {
|
2026-05-24 19:51:29 +00:00
|
|
|
type: string;
|
|
|
|
|
icon: React.ReactNode;
|
|
|
|
|
color: string;
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
bgColor: string;
|
2026-05-24 19:51:29 +00:00
|
|
|
label: string;
|
|
|
|
|
} {
|
2026-05-24 22:47:47 +00:00
|
|
|
if (item.item_status === 'problem' || item.problem_flag) {
|
2026-05-24 19:51:29 +00:00
|
|
|
return {
|
|
|
|
|
type: 'problem',
|
|
|
|
|
icon: <AlertTriangle size={16} />,
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
color: 'text-red-600',
|
|
|
|
|
bgColor: 'bg-red-50',
|
2026-05-24 19:51:29 +00:00
|
|
|
label: 'Problem',
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-24 22:47:47 +00:00
|
|
|
const orderNumber = item.expand?.order?.order_number || '';
|
2026-05-24 19:51:29 +00:00
|
|
|
|
|
|
|
|
if (orderNumber.toLowerCase().includes('breakdown')) {
|
|
|
|
|
return {
|
|
|
|
|
type: 'breakdown',
|
|
|
|
|
icon: <Hammer size={16} />,
|
|
|
|
|
color: 'text-orange-600',
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
bgColor: 'bg-orange-50',
|
2026-05-24 19:51:29 +00:00
|
|
|
label: 'Breakdown',
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (orderNumber.toLowerCase().includes('repair')) {
|
|
|
|
|
return {
|
|
|
|
|
type: 'repair',
|
|
|
|
|
icon: <Wrench size={16} />,
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
color: 'text-amber-600',
|
|
|
|
|
bgColor: 'bg-amber-50',
|
2026-05-24 19:51:29 +00:00
|
|
|
label: 'Repair',
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-24 22:47:47 +00:00
|
|
|
if (item.is_stock_item) {
|
2026-05-24 19:51:29 +00:00
|
|
|
return {
|
2026-05-24 22:47:47 +00:00
|
|
|
type: 'stock',
|
2026-05-24 19:51:29 +00:00
|
|
|
icon: <Package size={16} />,
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
color: 'text-violet-600',
|
|
|
|
|
bgColor: 'bg-violet-50',
|
2026-05-24 22:47:47 +00:00
|
|
|
label: 'Stock',
|
2026-05-24 19:51:29 +00:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
type: 'normal',
|
|
|
|
|
icon: <ShoppingCart size={16} />,
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
color: 'text-orange-600',
|
|
|
|
|
bgColor: 'bg-orange-50',
|
2026-05-24 19:51:29 +00:00
|
|
|
label: 'Order',
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default function CollectionItemCard({
|
2026-05-24 22:47:47 +00:00
|
|
|
item,
|
2026-05-26 22:55:21 +00:00
|
|
|
supplierColor,
|
|
|
|
|
compact,
|
2026-05-24 19:51:29 +00:00
|
|
|
onCollect,
|
|
|
|
|
onProblem,
|
|
|
|
|
onNavigate,
|
|
|
|
|
}: CollectionItemProps) {
|
|
|
|
|
const [expanded, setExpanded] = useState(false);
|
|
|
|
|
|
2026-05-24 22:47:47 +00:00
|
|
|
const supplier = item.expand?.supplier;
|
|
|
|
|
const itemType = getItemType(item);
|
2026-05-24 20:31:35 +00:00
|
|
|
const coords = parseCoordinates(supplier?.coordinates);
|
|
|
|
|
const hasCoords = coords !== null;
|
2026-05-24 22:47:47 +00:00
|
|
|
const description = item.description || 'Unknown item';
|
|
|
|
|
const expectedQty = item.order_qty || item.quantity || 0;
|
2026-05-26 22:55:21 +00:00
|
|
|
const colorAccent = supplierColor?.border || 'border-l-orange-400';
|
2026-05-24 19:51:29 +00:00
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
className={cn(
|
2026-05-26 22:55:21 +00:00
|
|
|
compact
|
|
|
|
|
? 'bg-gray-50 rounded-xl overflow-hidden'
|
|
|
|
|
: 'bg-white rounded-2xl card-shadow card-press overflow-hidden',
|
|
|
|
|
(item.item_status === 'problem' || item.problem_flag) && 'ring-1 ring-red-400',
|
|
|
|
|
item.item_status === 'assigned' && !compact && `border-l-[3px] ${colorAccent}`
|
2026-05-24 19:51:29 +00:00
|
|
|
)}
|
|
|
|
|
>
|
|
|
|
|
{/* Header */}
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
<button
|
|
|
|
|
className="w-full text-left p-4 active:bg-gray-50/50 transition-colors"
|
2026-05-24 19:51:29 +00:00
|
|
|
onClick={() => setExpanded(!expanded)}
|
|
|
|
|
>
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
<div className="flex items-start gap-3">
|
|
|
|
|
{/* Type icon */}
|
|
|
|
|
<div className={cn(
|
|
|
|
|
'w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0 mt-0.5',
|
|
|
|
|
itemType.bgColor
|
|
|
|
|
)}>
|
|
|
|
|
<span className={itemType.color}>{itemType.icon}</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-05-24 19:51:29 +00:00
|
|
|
<div className="flex-1 min-w-0">
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
<div className="flex items-center gap-2 mb-0.5">
|
|
|
|
|
<h3 className="font-semibold text-[15px] text-gray-900 truncate leading-snug">
|
2026-05-24 19:51:29 +00:00
|
|
|
{description}
|
|
|
|
|
</h3>
|
|
|
|
|
</div>
|
|
|
|
|
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
<div className="flex items-center gap-1.5 flex-wrap">
|
|
|
|
|
<span className={cn(
|
|
|
|
|
'text-[10px] px-2 py-0.5 rounded-full font-semibold uppercase tracking-wide',
|
|
|
|
|
itemType.type === 'problem' && 'bg-red-100 text-red-700',
|
|
|
|
|
itemType.type === 'breakdown' && 'bg-orange-100 text-orange-700',
|
|
|
|
|
itemType.type === 'repair' && 'bg-amber-100 text-amber-700',
|
|
|
|
|
itemType.type === 'stock' && 'bg-violet-100 text-violet-700',
|
|
|
|
|
itemType.type === 'normal' && 'bg-orange-100 text-orange-700'
|
|
|
|
|
)}>
|
|
|
|
|
{itemType.label}
|
|
|
|
|
</span>
|
|
|
|
|
<span className="text-xs text-gray-400">Qty: {expectedQty}</span>
|
2026-05-24 22:47:47 +00:00
|
|
|
{item.collection_date && (
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
<span className="text-xs text-gray-400 flex items-center gap-0.5">
|
|
|
|
|
<Clock size={10} />
|
|
|
|
|
{formatDate(item.collection_date)}
|
|
|
|
|
</span>
|
2026-05-24 19:51:29 +00:00
|
|
|
)}
|
|
|
|
|
</div>
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
|
|
|
|
|
{supplier?.suppliername && (
|
|
|
|
|
<div className="flex items-center gap-1 mt-1.5">
|
|
|
|
|
<MapPin size={12} className="text-gray-400 flex-shrink-0" />
|
|
|
|
|
<span className="text-xs text-gray-500 truncate">{supplier.suppliername}</span>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
2026-05-24 19:51:29 +00:00
|
|
|
</div>
|
|
|
|
|
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
<div className="flex items-center gap-2 flex-shrink-0">
|
|
|
|
|
{item.selling_price && expectedQty > 0 && (
|
|
|
|
|
<span className="text-xs font-semibold text-green-600">
|
|
|
|
|
{formatCurrency(item.selling_price * expectedQty)}
|
|
|
|
|
</span>
|
|
|
|
|
)}
|
2026-05-24 19:51:29 +00:00
|
|
|
{expanded ? (
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
<ChevronUp size={18} className="text-gray-400" />
|
2026-05-24 19:51:29 +00:00
|
|
|
) : (
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
<ChevronDown size={18} className="text-gray-400" />
|
2026-05-24 19:51:29 +00:00
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
</button>
|
2026-05-24 19:51:29 +00:00
|
|
|
|
|
|
|
|
{/* Expanded Details */}
|
|
|
|
|
{expanded && (
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
<div className="px-4 pb-4 border-t border-gray-100 animate-fade-in">
|
|
|
|
|
<div className="pt-3 space-y-3">
|
|
|
|
|
{/* Notes */}
|
|
|
|
|
{item.notes && (
|
|
|
|
|
<div className="bg-amber-50 border border-amber-100 rounded-xl p-3">
|
|
|
|
|
<p className="text-xs text-amber-800 flex items-start gap-2">
|
|
|
|
|
<AlertCircle size={14} className="flex-shrink-0 mt-0.5" />
|
|
|
|
|
<span className="selectable">{item.notes}</span>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{item.problem_notes && (
|
|
|
|
|
<div className="bg-red-50 border border-red-100 rounded-xl p-3">
|
|
|
|
|
<p className="text-xs text-red-700 flex items-start gap-2">
|
|
|
|
|
<AlertTriangle size={14} className="flex-shrink-0 mt-0.5" />
|
|
|
|
|
<span className="selectable">{item.problem_notes}</span>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{/* Details grid */}
|
|
|
|
|
<div className="grid grid-cols-2 gap-2 text-xs">
|
|
|
|
|
{item.expand?.order?.order_number && (
|
|
|
|
|
<div className="bg-gray-50 rounded-lg p-2">
|
|
|
|
|
<span className="text-gray-400 block">Order</span>
|
|
|
|
|
<span className="text-gray-700 font-medium">{item.expand.order.order_number}</span>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
{item.expand?.purchase_order?.po_number && (
|
|
|
|
|
<div className="bg-gray-50 rounded-lg p-2">
|
|
|
|
|
<span className="text-gray-400 block">PO</span>
|
|
|
|
|
<span className="text-gray-700 font-medium">{item.expand.purchase_order.po_number}</span>
|
|
|
|
|
</div>
|
2026-05-24 19:51:29 +00:00
|
|
|
)}
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
{supplier?.supplieraddress && (
|
|
|
|
|
<div className="bg-gray-50 rounded-lg p-2 col-span-2">
|
|
|
|
|
<span className="text-gray-400 block">Address</span>
|
|
|
|
|
<span className="text-gray-700 font-medium selectable">{supplier.supplieraddress}</span>
|
|
|
|
|
</div>
|
2026-05-24 19:51:29 +00:00
|
|
|
)}
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
</div>
|
2026-05-24 19:51:29 +00:00
|
|
|
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
{/* Action Buttons */}
|
|
|
|
|
<div className="grid grid-cols-3 gap-2 pt-1">
|
2026-05-24 19:51:29 +00:00
|
|
|
<button
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
onClick={() => onCollect(item)}
|
|
|
|
|
className="flex flex-col items-center justify-center gap-1 py-3 rounded-xl bg-green-500 text-white active:bg-green-600 transition-colors touch-manipulation press-feedback-sm"
|
2026-05-24 19:51:29 +00:00
|
|
|
>
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
<Check size={18} strokeWidth={2.5} />
|
|
|
|
|
<span className="text-xs font-semibold">Collect</span>
|
2026-05-24 19:51:29 +00:00
|
|
|
</button>
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
|
|
|
|
|
<button
|
|
|
|
|
onClick={() => onProblem(item)}
|
|
|
|
|
className="flex flex-col items-center justify-center gap-1 py-3 rounded-xl bg-red-500 text-white active:bg-red-600 transition-colors touch-manipulation press-feedback-sm"
|
|
|
|
|
>
|
|
|
|
|
<AlertTriangle size={18} strokeWidth={2.5} />
|
|
|
|
|
<span className="text-xs font-semibold">Problem</span>
|
|
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
{hasCoords && coords && supplier ? (
|
|
|
|
|
<button
|
|
|
|
|
onClick={() => onNavigate(coords.latitude, coords.longitude, supplier.suppliername)}
|
|
|
|
|
className="flex flex-col items-center justify-center gap-1 py-3 rounded-xl bg-orange-500 text-white active:bg-orange-600 transition-colors touch-manipulation press-feedback-sm"
|
|
|
|
|
>
|
|
|
|
|
<Navigation size={18} strokeWidth={2.5} />
|
|
|
|
|
<span className="text-xs font-semibold">Navigate</span>
|
|
|
|
|
</button>
|
|
|
|
|
) : (
|
|
|
|
|
<div className="flex flex-col items-center justify-center gap-1 py-3 rounded-xl bg-gray-100 text-gray-400">
|
|
|
|
|
<Navigation size={18} />
|
|
|
|
|
<span className="text-xs font-medium">No GPS</span>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
2026-05-24 19:51:29 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
Add PWA support and UI redesign
Add full PWA support (icons, manifest, service worker, pwa lib and bridge) and introduce install/offline UI. Generate app icons via a new scripts/generate-icons.js and include multiple icon sizes in public/icons; update manifest and layout head meta/preconnect. Revamp global styles (globals.css) with new utilities, animations, spacing for bottom nav, card shadows, skeletons and accessibility tweaks. Polish major screens (login, collections, map, settings) with improved headers, loading states, touch/press feedback, and layout adjustments; add new components (InstallPrompt, OfflineIndicator, PWABridge) and update various components to match new visual/UX patterns. Update Dockerfile to generate icons and use Next.js static export output (/out) for nginx, and bump package setup to support icon generation.
2026-05-26 22:34:50 +00:00
|
|
|
}
|