diff --git a/frontend/src/components/locations/LocationsPage.tsx b/frontend/src/components/locations/LocationsPage.tsx index d6c488a..d43a2e9 100644 --- a/frontend/src/components/locations/LocationsPage.tsx +++ b/frontend/src/components/locations/LocationsPage.tsx @@ -1,5 +1,5 @@ import { useState, useMemo, useRef, useEffect } from 'react'; -import { Plus, MapPin, Phone, Mail } from 'lucide-react'; +import { Plus, MapPin, Phone, Mail, Tag, AlignLeft } from 'lucide-react'; import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'; import { toast } from 'sonner'; import api, { getErrorMessage } from '@/lib/api'; @@ -240,11 +240,11 @@ export default function LocationsPage() { ]; const panelFields: PanelField[] = [ - { label: 'Address', key: 'address', copyable: true, icon: MapPin }, { label: 'Contact Number', key: 'contact_number', copyable: true, icon: Phone }, { label: 'Email', key: 'email', copyable: true, icon: Mail }, - { label: 'Category', key: 'category' }, - { label: 'Notes', key: 'notes', multiline: true }, + { label: 'Category', key: 'category', icon: Tag }, + { label: 'Address', key: 'address', copyable: true, icon: MapPin, fullWidth: true }, + { label: 'Notes', key: 'notes', multiline: true, icon: AlignLeft, fullWidth: true }, ]; const renderPanel = () => ( diff --git a/frontend/src/components/people/PeoplePage.tsx b/frontend/src/components/people/PeoplePage.tsx index 67b8113..b38318d 100644 --- a/frontend/src/components/people/PeoplePage.tsx +++ b/frontend/src/components/people/PeoplePage.tsx @@ -1,5 +1,5 @@ import { useState, useMemo, useRef, useEffect } from 'react'; -import { Plus, Users, Star, Cake, Phone, Mail, MapPin } from 'lucide-react'; +import { Plus, Users, Star, Cake, Phone, Mail, MapPin, Tag, Building2, Briefcase, AlignLeft } from 'lucide-react'; import type { LucideIcon } from 'lucide-react'; import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'; import { format, parseISO, differenceInYears } from 'date-fns'; @@ -173,12 +173,12 @@ const panelFields: PanelField[] = [ { label: 'Mobile', key: 'mobile', copyable: true, icon: Phone }, { label: 'Phone', key: 'phone', copyable: true, icon: Phone }, { label: 'Email', key: 'email', copyable: true, icon: Mail }, - { label: 'Address', key: 'address', copyable: true, icon: MapPin }, - { label: 'Birthday', key: 'birthday_display' }, - { label: 'Category', key: 'category' }, - { label: 'Company', key: 'company' }, - { label: 'Job Title', key: 'job_title' }, - { label: 'Notes', key: 'notes', multiline: true }, + { label: 'Birthday', key: 'birthday_display', icon: Cake }, + { label: 'Category', key: 'category', icon: Tag }, + { label: 'Company', key: 'company', icon: Building2 }, + { label: 'Job Title', key: 'job_title', icon: Briefcase }, + { label: 'Address', key: 'address', copyable: true, icon: MapPin, fullWidth: true }, + { label: 'Notes', key: 'notes', multiline: true, icon: AlignLeft, fullWidth: true }, ]; // --------------------------------------------------------------------------- diff --git a/frontend/src/components/shared/EntityDetailPanel.tsx b/frontend/src/components/shared/EntityDetailPanel.tsx index b118350..2a2781d 100644 --- a/frontend/src/components/shared/EntityDetailPanel.tsx +++ b/frontend/src/components/shared/EntityDetailPanel.tsx @@ -11,6 +11,7 @@ export interface PanelField { copyable?: boolean; icon?: LucideIcon; multiline?: boolean; + fullWidth?: boolean; } interface EntityDetailPanelProps { @@ -81,29 +82,54 @@ export function EntityDetailPanel({ {/* Body */}
- {fields.map((field) => { - const value = getValue(item, field.key); - if (!value) return null; + {(() => { + const gridFields = fields.filter((f) => !f.fullWidth && getValue(item, f.key)); + const fullWidthFields = fields.filter((f) => f.fullWidth && getValue(item, f.key)); + return ( -
- {field.copyable ? ( -
-

- {field.label} -

- -
- ) : ( -
-

- {field.label} -

-

{value}

+ <> + {gridFields.length > 0 && ( +
+ {gridFields.map((field) => { + const value = getValue(item, field.key)!; + return ( +
+
+ {field.icon && } + {field.label} +
+ {field.copyable ? ( + + ) : ( +

{value}

+ )} +
+ ); + })}
)} -
+ + {fullWidthFields.map((field) => { + const value = getValue(item, field.key)!; + return ( +
+
+ {field.icon && } + {field.label} +
+ {field.copyable ? ( + + ) : ( +

+ {value} +

+ )} +
+ ); + })} + ); - })} + })()}
{/* Footer */}