@open-mercato/core 0.6.7-develop.6594.1.5581f765f4 → 0.6.7-develop.6597.1.b8f069b7fe

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37,6 +37,7 @@ import { mapCrudServerErrorToFormErrors } from '@open-mercato/ui/backend/utils/s
37
37
  import { useT } from '@open-mercato/shared/lib/i18n/context'
38
38
  import { useConfirmDialog } from '@open-mercato/ui/backend/confirm-dialog'
39
39
  import { cn } from '@open-mercato/shared/lib/utils'
40
+ import { ContactEmailDisplay } from '@open-mercato/core/modules/sales/components/ContactEmailDisplay'
40
41
  import { DocumentCustomerCard } from '@open-mercato/core/modules/sales/components/DocumentCustomerCard'
41
42
  import { SalesDocumentAddressesSection } from '@open-mercato/core/modules/sales/components/documents/AddressesSection'
42
43
  import { SalesDocumentItemsSection } from '@open-mercato/core/modules/sales/components/documents/ItemsSection'
@@ -3976,21 +3977,9 @@ export default function SalesDocumentDetailPage({
3976
3977
  ]
3977
3978
 
3978
3979
  const renderEmailDisplay = React.useCallback(
3979
- ({ value, emptyLabel }: { value: string | null | undefined; emptyLabel: string }) => {
3980
- const emailValue = typeof value === 'string' ? value.trim() : ''
3981
- if (!emailValue.length) {
3982
- return <span className="text-sm text-muted-foreground">{emptyLabel}</span>
3983
- }
3984
- return (
3985
- <a
3986
- className="inline-flex items-center gap-2 text-sm text-primary hover:text-primary/80 hover:underline"
3987
- href={`mailto:${emailValue}`}
3988
- >
3989
- <Mail className="h-4 w-4" aria-hidden />
3990
- <span className="truncate">{emailValue}</span>
3991
- </a>
3992
- )
3993
- },
3980
+ ({ value, emptyLabel }: { value: string | null | undefined; emptyLabel: string }) => (
3981
+ <ContactEmailDisplay value={value} emptyLabel={emptyLabel} />
3982
+ ),
3994
3983
  []
3995
3984
  )
3996
3985
 
@@ -0,0 +1,27 @@
1
+ "use client"
2
+
3
+ import * as React from 'react'
4
+ import { Mail } from 'lucide-react'
5
+
6
+ type ContactEmailDisplayProps = {
7
+ value: string | null | undefined
8
+ emptyLabel: string
9
+ }
10
+
11
+ export function ContactEmailDisplay({ value, emptyLabel }: ContactEmailDisplayProps) {
12
+ const emailValue = typeof value === 'string' ? value.trim() : ''
13
+ if (!emailValue.length) {
14
+ return <span className="text-sm text-muted-foreground">{emptyLabel}</span>
15
+ }
16
+ return (
17
+ <a
18
+ className="inline-flex max-w-full items-center gap-2 text-sm text-primary hover:text-primary/80 hover:underline"
19
+ href={`mailto:${emailValue}`}
20
+ >
21
+ <Mail className="h-4 w-4 shrink-0" aria-hidden />
22
+ <span className="min-w-0 truncate" title={emailValue}>
23
+ {emailValue}
24
+ </span>
25
+ </a>
26
+ )
27
+ }