Преглед изворни кода

fix(dashboard): Fix displaying HistoryEntry for CustomerEmailUpdateComponent (#4167)

Tim Siebels пре 2 дана
родитељ
комит
bab3b5e55f

+ 31 - 29
packages/dashboard/src/app/routes/_authenticated/_customers/components/customer-history/default-customer-history-components.tsx

@@ -141,36 +141,38 @@ export function CustomerPasswordResetVerifiedComponent(props: Readonly<HistoryEn
     );
 }
 
-export function CustomerEmailUpdateComponent({ entry }: Readonly<HistoryEntryProps>) {
-    const { oldEmailAddress, newEmailAddress } = entry.data || {};
+export function CustomerEmailUpdateComponent(props: Readonly<HistoryEntryProps>) {
+    const { oldEmailAddress, newEmailAddress } = props.entry.data || {};
 
     return (
-        <div className="space-y-2">
-            {(oldEmailAddress || newEmailAddress) && (
-                <details className="text-xs">
-                    <summary className="cursor-pointer text-muted-foreground hover:text-foreground">
-                        <Trans>View details</Trans>
-                    </summary>
-                    <div className="mt-2 space-y-1">
-                        {oldEmailAddress && (
-                            <div>
-                                <span className="font-medium">
-                                    <Trans>Old email:</Trans>
-                                </span>{' '}
-                                {oldEmailAddress}
-                            </div>
-                        )}
-                        {newEmailAddress && (
-                            <div>
-                                <span className="font-medium">
-                                    <Trans>New email:</Trans>
-                                </span>{' '}
-                                {newEmailAddress}
-                            </div>
-                        )}
-                    </div>
-                </details>
-            )}
-        </div>
+        <HistoryEntry {...props}>
+            <div className="space-y-2">
+                {(oldEmailAddress || newEmailAddress) && (
+                    <details className="text-xs">
+                        <summary className="cursor-pointer text-muted-foreground hover:text-foreground">
+                            <Trans>View details</Trans>
+                        </summary>
+                        <div className="mt-2 space-y-1">
+                            {oldEmailAddress && (
+                                <div>
+                                    <span className="font-medium">
+                                        <Trans>Old email:</Trans>
+                                    </span>{' '}
+                                    {oldEmailAddress}
+                                </div>
+                            )}
+                            {newEmailAddress && (
+                                <div>
+                                    <span className="font-medium">
+                                        <Trans>New email:</Trans>
+                                    </span>{' '}
+                                    {newEmailAddress}
+                                </div>
+                            )}
+                        </div>
+                    </details>
+                )}
+            </div>
+        </HistoryEntry>
     );
 }