@inf-monkeys-tech/monkeys-design 2.0.362 → 2.0.363

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.
@@ -2,7 +2,9 @@ import { useEffect, useRef, useState, type ReactNode } from 'react';
2
2
 
3
3
  import { BaseDialog } from '../base/BaseDialog';
4
4
  import { BaseButton } from '../base/BaseButton';
5
+ import { BaseLink } from '../base/BaseLink';
5
6
  import { MediaPreviewImage } from '../primitives/MediaPreview';
7
+ import { useMonkeysLocale } from '../../provider/context';
6
8
 
7
9
  export interface WorkbenchMeasurementsData {
8
10
  garment_type?: string;
@@ -35,7 +37,11 @@ export function WorkbenchMeasurementsPreview({
35
37
  }: WorkbenchMeasurementsPreviewProps) {
36
38
  const [open, setOpen] = useState(false);
37
39
  const [failedImage, setFailedImage] = useState<string>();
40
+ const locale = useMonkeysLocale();
38
41
  const image = data.image?.trim();
42
+ const editHref = data.editHref?.trim();
43
+ const editLabel = locale.locale.toLowerCase().startsWith('zh') ? '编辑' : 'Edit';
44
+ const editTitle = `${editLabel} Techpack`;
39
45
  const [visibleRows, setVisibleRows] = useState(5);
40
46
  const summaryRef = useRef<HTMLDListElement>(null);
41
47
  useEffect(() => {
@@ -70,9 +76,20 @@ export function WorkbenchMeasurementsPreview({
70
76
  />
71
77
  </div>
72
78
  )}
73
- <span className="min-w-0 line-clamp-2 text-sm font-medium [overflow-wrap:anywhere]">
79
+ <span className="min-w-0 flex-1 line-clamp-2 text-sm font-medium [overflow-wrap:anywhere]">
74
80
  {data.garment_type || title}
75
81
  </span>
82
+ {editHref && (
83
+ <BaseLink
84
+ href={editHref}
85
+ aria-label={editTitle}
86
+ title={editTitle}
87
+ className="inline-flex shrink-0 items-center rounded-md border border-border px-2 py-1 text-sm font-medium no-underline"
88
+ style={{ height: 28, padding: '0 8px', textDecoration: 'none' }}
89
+ >
90
+ {editLabel}
91
+ </BaseLink>
92
+ )}
76
93
  </div>
77
94
  <dl
78
95
  ref={summaryRef}