From a8807155a26ef477bcf65d41a13ddf21cbd9b82b Mon Sep 17 00:00:00 2001 From: suryac Date: Mon, 3 Aug 2026 10:25:31 +0530 Subject: [PATCH] detail view polished --- index.html | 2 +- {src/assets => public}/favicon.ico | Bin src/components/dv/CallDetail.tsx | 130 ++++++++++++++++++--------- src/components/dv/DailyLogDetail.tsx | 26 +++--- src/components/dv/OrderDetail.tsx | 38 ++++---- src/components/dv/StoreDetail.tsx | 8 +- src/screens/LoginPage.tsx | 8 +- 7 files changed, 127 insertions(+), 85 deletions(-) rename {src/assets => public}/favicon.ico (100%) diff --git a/index.html b/index.html index a890e78..8e66ab3 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - + Krishna Sales diff --git a/src/assets/favicon.ico b/public/favicon.ico similarity index 100% rename from src/assets/favicon.ico rename to public/favicon.ico diff --git a/src/components/dv/CallDetail.tsx b/src/components/dv/CallDetail.tsx index 7c2fb89..ead15cf 100644 --- a/src/components/dv/CallDetail.tsx +++ b/src/components/dv/CallDetail.tsx @@ -21,6 +21,38 @@ import { ArrowLeft, } from 'lucide-react'; +const SafeImage = ({ src, alt, type, text, className }: { src: string, alt: string, type: 'store' | 'proof', text?: string, className?: string }) => { + const [error, setError] = useState(false); + + if (error) { + if (type === 'store') { + return ( +
+
+ +
+ {text || 'Image not available'} +
+ ); + } + return ( +
+ + {text || 'No proof image uploaded'} +
+ ); + } + + return ( + {alt} setError(true)} + /> + ); +}; + export interface CallDetailProps { instanceId: number | string; selectedRow?: Record; @@ -347,6 +379,7 @@ export function CallDetail({ const channel = String(rowSrc.order_received_channel || rowSrc.channel || data?.order_received_channel || 'No data'); const storeNotes = selectStore.notes || 'No notes available.'; + const visitNotes = String(rowSrc.notes || data?.notes || rowSrc.remarks || data?.remarks || rowSrc.remark || data?.remark || ''); const currentStateName = String(rowSrc.current_state_name || data?.current_state_name || 'No data'); return ( @@ -406,19 +439,19 @@ export function CallDetail({ {/* Top Right KPI Grid */}
-
+
TOTAL BAGS
{totalBags.toLocaleString()}
-
+
TOTAL KGS
{totalKgs.toLocaleString()}
-
-
LINE ITEMS
+
+
ORDER ITEMS
{lineItemsCount}
-
+
SALES OFFICER
{salesOfficer}
@@ -728,37 +761,47 @@ export function CallDetail({
{/* Right Store Proof Photo */} -
-
- UPLOADED PROOF -
- - {uploadedImages.length > 0 ? ( -
- {uploadedImages.map((file: any, idx: number) => { - const previewUrl = `${orderBookingClient.baseUrl}/app/${APP_ID}/view/files/${file.uuid}/preview`; - return ( -
- {file.original_name { - (e.target as HTMLImageElement).style.display = 'none'; - (e.target as HTMLImageElement).parentElement!.innerHTML = `
${file.original_name || 'Proof Image'}
`; - }} - /> - -
- ); - })} -
- ) : ( -
@@ -772,21 +815,20 @@ export function CallDetail({
{storeImages.length > 0 ? (
- Store Front { - (e.target as HTMLImageElement).style.display = 'none'; - }} />
) : ( -
-
+
+
- {storeName} + {storeName}
)}
@@ -845,9 +887,9 @@ export function CallDetail({
{/* Notes Container */} -
-
- NOTES +
+
+ NOTES

{storeNotes} diff --git a/src/components/dv/DailyLogDetail.tsx b/src/components/dv/DailyLogDetail.tsx index 7eb06b6..256c36a 100644 --- a/src/components/dv/DailyLogDetail.tsx +++ b/src/components/dv/DailyLogDetail.tsx @@ -284,12 +284,12 @@ export function DailyLogDetail({ instanceId, refreshKey, onPunchOut, onBack }: D Route Assignment

-
-
Route Code
+
+
Route Code
{String(routeCode)}
-
-
Sub Route
+
+
Sub Route
{String(subRoute)}
@@ -312,9 +312,9 @@ export function DailyLogDetail({ instanceId, refreshKey, onPunchOut, onBack }: D
); }) : ( -
- - No image uploaded +
+ + No image uploaded
)}
Uploaded at punch in.
@@ -329,8 +329,8 @@ export function DailyLogDetail({ instanceId, refreshKey, onPunchOut, onBack }: D
-
- +
+
Name
@@ -338,8 +338,8 @@ export function DailyLogDetail({ instanceId, refreshKey, onPunchOut, onBack }: D
-
- +
+
Email
@@ -347,8 +347,8 @@ export function DailyLogDetail({ instanceId, refreshKey, onPunchOut, onBack }: D
-
- +
+
User ID
diff --git a/src/components/dv/OrderDetail.tsx b/src/components/dv/OrderDetail.tsx index e4e99d9..eaf4ad1 100644 --- a/src/components/dv/OrderDetail.tsx +++ b/src/components/dv/OrderDetail.tsx @@ -127,9 +127,9 @@ export function OrderDetail({ instanceId }: WiredDetailViewProps) { Instance #{instanceId}
-
-
- Store +
+
+ Store
{String(storeName)}
@@ -157,7 +157,7 @@ export function OrderDetail({ instanceId }: WiredDetailViewProps) {
- Line Items + Order Items
{itemsArray.length}
@@ -166,19 +166,19 @@ export function OrderDetail({ instanceId }: WiredDetailViewProps) { {/* Bottom Section */}
{/* Left Table */} -
-
- - Order Items +
+
+ + Order Items
- + - - - - + + + + @@ -191,7 +191,7 @@ export function OrderDetail({ instanceId }: WiredDetailViewProps) { const weight = item.sku_3 ? `${item.sku_3} kg` : '-'; return ( - + ); })} - + @@ -232,8 +232,8 @@ export function OrderDetail({ instanceId }: WiredDetailViewProps) {
-
- +
+
Email
@@ -241,8 +241,8 @@ export function OrderDetail({ instanceId }: WiredDetailViewProps) {
-
- +
+
User ID
diff --git a/src/components/dv/StoreDetail.tsx b/src/components/dv/StoreDetail.tsx index 646a0e1..de119f2 100644 --- a/src/components/dv/StoreDetail.tsx +++ b/src/components/dv/StoreDetail.tsx @@ -301,16 +301,16 @@ export function StoreDetail({ instanceId, onBack, onEdit }: StoreDetailProps) {

Route Assignment

-
+
Route
{routeName ? String(routeName) : '-'}
Code {routeCode ? String(routeCode) : '-'}
-
+
Sub Route
{subRoute ? String(subRoute) : '-'}
-
+
Area
{area ? String(area) : '-'}
PIN {pinCode ? String(pinCode) : '-'}
@@ -360,7 +360,7 @@ export function StoreDetail({ instanceId, onBack, onEdit }: StoreDetailProps) {

Distributor

-
+
{distributorName ? String(distributorName) : '-'}
Owner · {distributorOwnerName ? String(distributorOwnerName) : '-'}
diff --git a/src/screens/LoginPage.tsx b/src/screens/LoginPage.tsx index 03b1f17..7ace2ae 100644 --- a/src/screens/LoginPage.tsx +++ b/src/screens/LoginPage.tsx @@ -36,18 +36,18 @@ export function LoginPage() { } return ( -
+
Logo

Krishna Sales

- setEmail(e.target.value)} required autoFocus /> - setPassword(e.target.value)} required /> + setEmail(e.target.value)} required autoFocus className="[&>div]:rounded-full [&>div:focus-within]:!border-emerald-500 [&>div:focus-within]:!shadow-[0_0_0_3px_rgba(16,185,129,0.3)]" /> + setPassword(e.target.value)} required className="[&>div]:rounded-full [&>div:focus-within]:!border-emerald-500 [&>div:focus-within]:!shadow-[0_0_0_3px_rgba(16,185,129,0.3)]" /> {error &&
{error}
} -
ProductCategorySKUBagsProductCategorySKUBags
{String(product)}
BR Code {String(brCode)}
@@ -205,7 +205,7 @@ export function OrderDetail({ instanceId }: WiredDetailViewProps) {
Total {String(totalBags)}