@djangocfg/layouts 2.1.110 → 2.1.111

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.
@@ -8,9 +8,10 @@
8
8
  */
9
9
 
10
10
  import { Bell, X } from 'lucide-react';
11
- import React, { useEffect, useState } from 'react';
11
+ import React, { useEffect, useMemo, useState } from 'react';
12
12
 
13
13
  import { useAuth } from '@djangocfg/api/auth';
14
+ import { useTypedT, type I18nTranslations } from '@djangocfg/i18n';
14
15
  import { Button } from '@djangocfg/ui-core';
15
16
 
16
17
  import { usePushNotifications } from '../hooks/usePushNotifications';
@@ -66,10 +67,19 @@ export function PushPrompt({
66
67
  vapidPublicKey,
67
68
  subscribeEndpoint,
68
69
  });
70
+ const t = useTypedT<I18nTranslations>();
69
71
 
70
72
  const [show, setShow] = useState(false);
71
73
  const [enabling, setEnabling] = useState(false);
72
74
 
75
+ const labels = useMemo(() => ({
76
+ enableNotifications: t('layouts.push.enableNotifications'),
77
+ stayUpdated: t('layouts.push.stayUpdated'),
78
+ enable: t('layouts.push.enable'),
79
+ notNow: t('layouts.push.notNow'),
80
+ dismiss: t('layouts.push.dismiss'),
81
+ }), [t]);
82
+
73
83
  // Check if should show
74
84
  useEffect(() => {
75
85
  // Wait for auth to complete, don't show for unauthenticated users
@@ -132,9 +142,9 @@ export function PushPrompt({
132
142
 
133
143
  {/* Content */}
134
144
  <div className="flex-1 min-w-0">
135
- <p className="text-sm font-medium text-white mb-1">Enable notifications</p>
145
+ <p className="text-sm font-medium text-white mb-1">{labels.enableNotifications}</p>
136
146
  <p className="text-xs text-zinc-400 mb-3">
137
- Stay updated with important updates and alerts
147
+ {labels.stayUpdated}
138
148
  </p>
139
149
 
140
150
  {/* Actions */}
@@ -145,14 +155,14 @@ export function PushPrompt({
145
155
  size="sm"
146
156
  variant="default"
147
157
  >
148
- Enable
158
+ {labels.enable}
149
159
  </Button>
150
160
  <Button
151
161
  onClick={handleDismiss}
152
162
  size="sm"
153
163
  variant="ghost"
154
164
  >
155
- Not now
165
+ {labels.notNow}
156
166
  </Button>
157
167
  </div>
158
168
  </div>
@@ -163,7 +173,7 @@ export function PushPrompt({
163
173
  size="sm"
164
174
  variant="ghost"
165
175
  className="flex-shrink-0 p-1"
166
- aria-label="Dismiss"
176
+ aria-label={labels.dismiss}
167
177
  >
168
178
  <X className="w-4 h-4" />
169
179
  </Button>