@wasto/cms-components 1.5.10

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.
Files changed (94) hide show
  1. package/README.md +47 -0
  2. package/dist/index.d.mts +465 -0
  3. package/dist/index.d.ts +465 -0
  4. package/dist/index.js +10445 -0
  5. package/dist/index.mjs +10553 -0
  6. package/package.json +90 -0
  7. package/src/components/announcement-modal/AnnouncementModal.tsx +183 -0
  8. package/src/components/article/Article.tsx +22 -0
  9. package/src/components/article/ArticleCard.tsx +81 -0
  10. package/src/components/article/ArticleExcerpts.tsx +80 -0
  11. package/src/components/article/ArticleList.tsx +114 -0
  12. package/src/components/article/ArticleMarkdown.tsx +170 -0
  13. package/src/components/article/ArticleReaderModal.tsx +93 -0
  14. package/src/components/article/ArticleSingle.tsx +57 -0
  15. package/src/components/bottom-tab/BottomTab.tsx +392 -0
  16. package/src/components/button/Button.tsx +154 -0
  17. package/src/components/challenge/Badges.tsx +84 -0
  18. package/src/components/challenge/BadgesModal.tsx +166 -0
  19. package/src/components/challenge/Challenge.tsx +380 -0
  20. package/src/components/challenge/ChallengeModal.tsx +231 -0
  21. package/src/components/challenge/ChallengeVignette.tsx +249 -0
  22. package/src/components/challenge/ChallengesModal.tsx +243 -0
  23. package/src/components/challenge/QuizModal.tsx +381 -0
  24. package/src/components/challenge/ResultModal.tsx +144 -0
  25. package/src/components/chat/Chat.tsx +928 -0
  26. package/src/components/collection-calendar/CollectionCalendar.tsx +274 -0
  27. package/src/components/columns/Columns.tsx +34 -0
  28. package/src/components/consignes-modal/ConsignesModal.tsx +267 -0
  29. package/src/components/content-inset/ContentInset.tsx +33 -0
  30. package/src/components/header/Header.tsx +391 -0
  31. package/src/components/image/Image.tsx +16 -0
  32. package/src/components/image/ImageFrame.tsx +102 -0
  33. package/src/components/image/ImageMedia.tsx +31 -0
  34. package/src/components/image/ImageUrl.tsx +30 -0
  35. package/src/components/locations-map/LocationSheet.tsx +417 -0
  36. package/src/components/locations-map/LocationsMap.native.tsx +260 -0
  37. package/src/components/locations-map/LocationsMap.tsx +13 -0
  38. package/src/components/locations-map/LocationsMap.web.tsx +10 -0
  39. package/src/components/locations-map/LocationsMapShell.tsx +527 -0
  40. package/src/components/locations-map/LocationsMapView.tsx +108 -0
  41. package/src/components/locations-map/LocationsMapView.web.tsx +331 -0
  42. package/src/components/nav-button/NavButton.tsx +59 -0
  43. package/src/components/next-collection/NextCollection.tsx +621 -0
  44. package/src/components/notifications/NotificationsScreen.tsx +247 -0
  45. package/src/components/page/Page.tsx +64 -0
  46. package/src/components/parapraph/Paragraph.tsx +67 -0
  47. package/src/components/profile/ProfileScreen.tsx +236 -0
  48. package/src/components/recycling-info/RecyclingInfo.tsx +189 -0
  49. package/src/components/safe-area/OptionalSafeAreaProvider.tsx +17 -0
  50. package/src/components/search/Search.tsx +320 -0
  51. package/src/components/select-street-modal/SelectStreetModal.tsx +475 -0
  52. package/src/components/title/Title.tsx +100 -0
  53. package/src/components/vision/Vision.tsx +447 -0
  54. package/src/components/vision/VisionActionCard.tsx +117 -0
  55. package/src/components/vision/VisionCapture.tsx +30 -0
  56. package/src/components/vision/VisionTapOverlay.tsx +122 -0
  57. package/src/contexts/AnnouncementsContext.tsx +171 -0
  58. package/src/contexts/ChallengesContext.tsx +182 -0
  59. package/src/contexts/LocalContext.tsx +227 -0
  60. package/src/contexts/ThemeContext.tsx +37 -0
  61. package/src/contexts/WastoContext.tsx +127 -0
  62. package/src/helpers/blogPost.ts +72 -0
  63. package/src/helpers/generateQuizQuestions.ts +247 -0
  64. package/src/helpers/getContrastColor.ts +19 -0
  65. package/src/helpers/haptics.ts +20 -0
  66. package/src/helpers/hoursSchedule.ts +230 -0
  67. package/src/helpers/htmlContentToMarkdown.ts +114 -0
  68. package/src/helpers/layout.ts +54 -0
  69. package/src/helpers/loadLinearGradient.ts +22 -0
  70. package/src/helpers/maquetteTheme.ts +76 -0
  71. package/src/helpers/markdownUnderlinePlugin.ts +32 -0
  72. package/src/helpers/normalizeWasteTypeRecyclingInfo.ts +80 -0
  73. package/src/helpers/publicMediaUrl.ts +8 -0
  74. package/src/helpers/resolveApiAssetUrl.ts +21 -0
  75. package/src/helpers/systemRoutes.ts +7 -0
  76. package/src/helpers/themeStyles.ts +114 -0
  77. package/src/helpers/useSafeAreaPadding.ts +14 -0
  78. package/src/hooks/useBadges.ts +100 -0
  79. package/src/hooks/useBlogPosts.ts +105 -0
  80. package/src/hooks/useChallenges.ts +110 -0
  81. package/src/hooks/useCities.ts +56 -0
  82. package/src/hooks/useCityAnnouncements.ts +118 -0
  83. package/src/hooks/useCollectionCalendar.ts +421 -0
  84. package/src/hooks/useColumns.ts +20 -0
  85. package/src/hooks/useConsignes.ts +62 -0
  86. package/src/hooks/useLocations.ts +248 -0
  87. package/src/hooks/useNextCollection.ts +238 -0
  88. package/src/hooks/useRecyclingInfo.ts +90 -0
  89. package/src/hooks/useWastoClient.ts +16 -0
  90. package/src/index.ts +142 -0
  91. package/src/navigation/NavigationContext.tsx +56 -0
  92. package/src/sentry/initSentry.ts +120 -0
  93. package/src/types/Theme.ts +72 -0
  94. package/src/types/css-modules.d.ts +1 -0
@@ -0,0 +1,391 @@
1
+ import { Bell, ChevronLeftIcon, User } from "lucide-react-native";
2
+ import {
3
+ Image,
4
+ Pressable,
5
+ StyleSheet,
6
+ View,
7
+ type ImageStyle,
8
+ } from "react-native";
9
+ import { useTheme } from "../../contexts/ThemeContext";
10
+ import { useWasto } from "../../contexts/WastoContext";
11
+ import { useSafeAreaPadding } from "../../helpers/useSafeAreaPadding";
12
+ import { Title } from "../title/Title";
13
+ import { Theme } from "../../types/Theme";
14
+ import { useMemo, type ReactNode } from "react";
15
+ import { resolveTheme } from "../../helpers/themeStyles";
16
+ import { useAnnouncements } from "../../contexts/AnnouncementsContext";
17
+ import { hapticSelection } from "../../helpers/haptics";
18
+ import { SPACE } from "../../helpers/layout";
19
+ import { SYSTEM_ROUTES } from "../../helpers/systemRoutes";
20
+ import { useAppNavigation } from "../../navigation/NavigationContext";
21
+ import { publicMediaUrl } from "../../helpers/publicMediaUrl";
22
+
23
+ export type AppHeaderSlot = "left" | "center" | "right";
24
+
25
+ export type AppHeaderLogoElement = {
26
+ id: string;
27
+ type: "logo";
28
+ slot: AppHeaderSlot;
29
+ sourceType: "url" | "media";
30
+ url?: string;
31
+ mediaId?: string;
32
+ };
33
+
34
+ export type AppHeaderTitleElement = {
35
+ id: string;
36
+ type: "title";
37
+ slot: AppHeaderSlot;
38
+ useScreenTitle?: boolean;
39
+ text?: string;
40
+ };
41
+
42
+ export type AppHeaderActionElement = {
43
+ id: string;
44
+ type: "action";
45
+ slot: AppHeaderSlot;
46
+ icon: string;
47
+ label?: string;
48
+ action: "navigate" | "back";
49
+ href?: string;
50
+ };
51
+
52
+ export type AppHeaderElement =
53
+ | AppHeaderLogoElement
54
+ | AppHeaderTitleElement
55
+ | AppHeaderActionElement;
56
+
57
+ export type AppHeaderConfig = {
58
+ elements: AppHeaderElement[];
59
+ };
60
+
61
+ export type HeaderProps = {
62
+ readonly options: { title?: string; headerBackVisible?: boolean };
63
+ readonly route: { name: string };
64
+ readonly navigation: {
65
+ canGoBack: () => boolean;
66
+ goBack: () => void;
67
+ };
68
+ /** Flotte au-dessus du contenu (ex. carte) : fond transparent. */
69
+ readonly overlay?: boolean;
70
+ /** Config layout (`header.elements`) — logo / titre / actions. */
71
+ readonly headerConfig?: AppHeaderConfig | null;
72
+ };
73
+
74
+ function resolveLogoUri(
75
+ apiUrl: string,
76
+ el: AppHeaderLogoElement,
77
+ ): string | null {
78
+ if (el.sourceType === "media") {
79
+ return publicMediaUrl(apiUrl, el.mediaId);
80
+ }
81
+ const url = (el.url || "").trim();
82
+ return url || null;
83
+ }
84
+
85
+ function HeaderLogo({
86
+ element,
87
+ }: {
88
+ readonly element: AppHeaderLogoElement;
89
+ }): ReactNode {
90
+ const { apiUrl } = useWasto();
91
+ const uri = resolveLogoUri(apiUrl, element);
92
+ if (!uri) return null;
93
+ return (
94
+ <Image
95
+ source={{ uri }}
96
+ style={styles.logo as ImageStyle}
97
+ resizeMode="contain"
98
+ accessibilityLabel="Logo"
99
+ />
100
+ );
101
+ }
102
+
103
+ function HeaderActionButton({
104
+ onPress,
105
+ accessibilityLabel,
106
+ children,
107
+ themedStyles,
108
+ borderRadius,
109
+ }: {
110
+ readonly onPress: () => void;
111
+ readonly accessibilityLabel: string;
112
+ readonly children: ReactNode;
113
+ readonly themedStyles: ReturnType<typeof createThemedStyles>;
114
+ readonly borderRadius: number;
115
+ }): ReactNode {
116
+ return (
117
+ <Pressable
118
+ onPress={onPress}
119
+ style={[styles.iconBtn, themedStyles.iconBtn, { borderRadius }]}
120
+ accessibilityLabel={accessibilityLabel}
121
+ >
122
+ {children}
123
+ </Pressable>
124
+ );
125
+ }
126
+
127
+ export function Header({
128
+ options,
129
+ route,
130
+ navigation,
131
+ overlay = false,
132
+ headerConfig,
133
+ }: HeaderProps): ReactNode {
134
+ const { theme } = useTheme();
135
+ const t = resolveTheme(theme);
136
+ const themedStyles = createThemedStyles(theme);
137
+ const topInset = useSafeAreaPadding(["top"]);
138
+ const { hasUnread } = useAnnouncements();
139
+ const { push } = useAppNavigation();
140
+
141
+ const screenTitle = useMemo(
142
+ () => options.title ?? route.name,
143
+ [options.title, route.name],
144
+ );
145
+
146
+ const elements = headerConfig?.elements ?? [];
147
+ const hasCustom = elements.length > 0;
148
+ const hasCustomActions = elements.some((el) => el.type === "action");
149
+
150
+ const bySlot = useMemo(() => {
151
+ const left: AppHeaderElement[] = [];
152
+ const center: AppHeaderElement[] = [];
153
+ const right: AppHeaderElement[] = [];
154
+ for (const el of elements) {
155
+ if (el.slot === "center") center.push(el);
156
+ else if (el.slot === "right") right.push(el);
157
+ else left.push(el);
158
+ }
159
+ return { left, center, right };
160
+ }, [elements]);
161
+
162
+ const onBell = async () => {
163
+ await hapticSelection();
164
+ push(SYSTEM_ROUTES.notifications);
165
+ };
166
+
167
+ const onProfile = async () => {
168
+ await hapticSelection();
169
+ push(SYSTEM_ROUTES.profile);
170
+ };
171
+
172
+ const renderElement = (el: AppHeaderElement): ReactNode => {
173
+ if (el.type === "logo") {
174
+ return <HeaderLogo key={el.id} element={el} />;
175
+ }
176
+ if (el.type === "title") {
177
+ const text =
178
+ el.useScreenTitle !== false
179
+ ? screenTitle
180
+ : (el.text || "").trim() || screenTitle;
181
+ return <Title key={el.id} text={text} level="1" />;
182
+ }
183
+ // action
184
+ const onPress = async () => {
185
+ await hapticSelection();
186
+ if (el.action === "back") {
187
+ if (navigation.canGoBack()) navigation.goBack();
188
+ return;
189
+ }
190
+ const href = (el.href || "").trim();
191
+ if (href) push(href);
192
+ };
193
+ const label = el.label?.trim() || el.icon || "Action";
194
+ // Icônes système connues (bell / person) — le reste tombe sur Bell.
195
+ const Icon =
196
+ el.icon === "person" || el.icon === "users"
197
+ ? User
198
+ : Bell;
199
+ return (
200
+ <HeaderActionButton
201
+ key={el.id}
202
+ onPress={onPress}
203
+ accessibilityLabel={label}
204
+ themedStyles={themedStyles}
205
+ borderRadius={t.radii.pill}
206
+ >
207
+ <Icon size={SPACE.iconGlyph} color={theme.colors.primary} />
208
+ {el.icon === "bell" && hasUnread ? (
209
+ <View
210
+ style={[
211
+ styles.badge,
212
+ { backgroundColor: theme.colors.error },
213
+ ]}
214
+ />
215
+ ) : null}
216
+ </HeaderActionButton>
217
+ );
218
+ };
219
+
220
+ const showBack =
221
+ navigation.canGoBack() && options.headerBackVisible !== false;
222
+
223
+ const defaultActions = (
224
+ <>
225
+ <HeaderActionButton
226
+ onPress={onBell}
227
+ accessibilityLabel="Notifications"
228
+ themedStyles={themedStyles}
229
+ borderRadius={t.radii.pill}
230
+ >
231
+ <Bell size={SPACE.iconGlyph} color={theme.colors.primary} />
232
+ {hasUnread ? (
233
+ <View
234
+ style={[
235
+ styles.badge,
236
+ { backgroundColor: theme.colors.error },
237
+ ]}
238
+ />
239
+ ) : null}
240
+ </HeaderActionButton>
241
+ <HeaderActionButton
242
+ onPress={onProfile}
243
+ accessibilityLabel="Profil"
244
+ themedStyles={themedStyles}
245
+ borderRadius={t.radii.pill}
246
+ >
247
+ <User size={SPACE.iconGlyph} color={theme.colors.primary} />
248
+ </HeaderActionButton>
249
+ </>
250
+ );
251
+
252
+ return (
253
+ <View
254
+ style={[
255
+ styles.headerWrap,
256
+ overlay ? undefined : themedStyles.headerWrap,
257
+ topInset,
258
+ ]}
259
+ pointerEvents="box-none"
260
+ >
261
+ <View style={styles.header} pointerEvents="box-none">
262
+ {hasCustom ? (
263
+ <>
264
+ <View style={styles.slotLeft} pointerEvents="box-none">
265
+ {showBack ? (
266
+ <HeaderActionButton
267
+ onPress={() => navigation.goBack()}
268
+ accessibilityLabel="Retour"
269
+ themedStyles={themedStyles}
270
+ borderRadius={t.radii.pill}
271
+ >
272
+ <ChevronLeftIcon
273
+ size={SPACE.iconGlyph}
274
+ color={theme.colors.onSurface}
275
+ />
276
+ </HeaderActionButton>
277
+ ) : null}
278
+ {bySlot.left.map(renderElement)}
279
+ </View>
280
+ <View
281
+ style={styles.slotCenter}
282
+ pointerEvents="box-none"
283
+ >
284
+ {bySlot.center.map(renderElement)}
285
+ </View>
286
+ <View style={styles.slotRight} pointerEvents="box-none">
287
+ {bySlot.right.map(renderElement)}
288
+ {!hasCustomActions ? defaultActions : null}
289
+ </View>
290
+ </>
291
+ ) : (
292
+ <>
293
+ <View style={styles.left} pointerEvents="box-none">
294
+ {showBack ? (
295
+ <HeaderActionButton
296
+ onPress={() => navigation.goBack()}
297
+ accessibilityLabel="Retour"
298
+ themedStyles={themedStyles}
299
+ borderRadius={t.radii.pill}
300
+ >
301
+ <ChevronLeftIcon
302
+ size={SPACE.iconGlyph}
303
+ color={theme.colors.onSurface}
304
+ />
305
+ </HeaderActionButton>
306
+ ) : null}
307
+ <Title text={screenTitle} level="1" />
308
+ </View>
309
+ <View style={styles.actions}>{defaultActions}</View>
310
+ </>
311
+ )}
312
+ </View>
313
+ </View>
314
+ );
315
+ }
316
+
317
+ const createThemedStyles = (theme: Theme) =>
318
+ StyleSheet.create({
319
+ headerWrap: {
320
+ backgroundColor: theme.colors.background,
321
+ },
322
+ iconBtn: {
323
+ backgroundColor: theme.colors.surface,
324
+ borderWidth: 1,
325
+ borderColor: theme.colors.border,
326
+ },
327
+ });
328
+
329
+ const styles = StyleSheet.create({
330
+ headerWrap: {},
331
+ header: {
332
+ flexDirection: "row",
333
+ alignItems: "center",
334
+ justifyContent: "space-between",
335
+ paddingHorizontal: SPACE.pageX,
336
+ paddingVertical: 12,
337
+ gap: 10,
338
+ minHeight: 56,
339
+ },
340
+ left: {
341
+ flexDirection: "row",
342
+ alignItems: "center",
343
+ gap: 10,
344
+ flex: 1,
345
+ },
346
+ slotLeft: {
347
+ flexDirection: "row",
348
+ alignItems: "center",
349
+ gap: 10,
350
+ flexShrink: 1,
351
+ minWidth: 0,
352
+ },
353
+ slotCenter: {
354
+ flex: 1,
355
+ flexDirection: "row",
356
+ alignItems: "center",
357
+ justifyContent: "center",
358
+ gap: 8,
359
+ minWidth: 0,
360
+ },
361
+ slotRight: {
362
+ flexDirection: "row",
363
+ alignItems: "center",
364
+ gap: 8,
365
+ flexShrink: 0,
366
+ },
367
+ actions: {
368
+ flexDirection: "row",
369
+ alignItems: "center",
370
+ gap: 8,
371
+ },
372
+ iconBtn: {
373
+ width: SPACE.iconHit,
374
+ height: SPACE.iconHit,
375
+ alignItems: "center",
376
+ justifyContent: "center",
377
+ },
378
+ badge: {
379
+ position: "absolute",
380
+ top: 4,
381
+ right: 4,
382
+ width: 12,
383
+ height: 12,
384
+ borderRadius: 6,
385
+ },
386
+ logo: {
387
+ height: 32,
388
+ width: 120,
389
+ maxWidth: 160,
390
+ },
391
+ });
@@ -0,0 +1,16 @@
1
+ import type { ReactNode } from "react";
2
+ import { ImageMedia, ImageMediaProps } from "./ImageMedia";
3
+ import { ImageUrl, ImageUrlProps } from "./ImageUrl";
4
+
5
+ export type ImageProps =
6
+ | ImageUrlProps
7
+ | ImageMediaProps
8
+
9
+ export function Image(props: ImageProps): ReactNode {
10
+ switch(props.sourceType) {
11
+ case "url":
12
+ return <ImageUrl {...props}/>
13
+ case "media":
14
+ return <ImageMedia {...props}/>
15
+ }
16
+ }
@@ -0,0 +1,102 @@
1
+ import type { ReactNode } from "react";
2
+ import { StyleSheet, Text, View } from "react-native";
3
+ import { Image as ExpoImage } from "expo-image";
4
+ import { useTheme } from "../../contexts/ThemeContext";
5
+ import { Theme } from "../../types/Theme";
6
+
7
+ export type ImageFrameProps = {
8
+ uri: string | null;
9
+ alt?: string;
10
+ transparentBackground?: boolean;
11
+ showBorder?: boolean;
12
+ };
13
+
14
+ export function ImageFrame({
15
+ uri,
16
+ alt,
17
+ transparentBackground = false,
18
+ showBorder = true,
19
+ }: ImageFrameProps): ReactNode {
20
+ const { theme } = useTheme();
21
+ const themedStyles = createThemedStyles(theme);
22
+ const radius = transparentBackground && !showBorder ? 0 : theme.radius;
23
+
24
+ return (
25
+ <View
26
+ style={[
27
+ styles.frame,
28
+ {
29
+ backgroundColor: transparentBackground ? "transparent" : theme.colors.surface,
30
+ borderWidth: showBorder ? 1 : 0,
31
+ borderColor: theme.colors.border,
32
+ borderRadius: radius,
33
+ },
34
+ ]}
35
+ >
36
+ {uri ? (
37
+ <ExpoImage
38
+ source={uri}
39
+ style={[
40
+ styles.image,
41
+ { backgroundColor: transparentBackground ? "transparent" : undefined },
42
+ ]}
43
+ contentFit={transparentBackground ? "contain" : "cover"}
44
+ accessibilityLabel={alt}
45
+ />
46
+ ) : (
47
+ <View style={styles.placeholder}>
48
+ <Text style={themedStyles.placeholder}>Image indisponible</Text>
49
+ </View>
50
+ )}
51
+ {alt ? (
52
+ <Text
53
+ style={[
54
+ styles.caption,
55
+ themedStyles.caption,
56
+ transparentBackground && styles.captionBare,
57
+ ]}
58
+ >
59
+ {alt}
60
+ </Text>
61
+ ) : null}
62
+ </View>
63
+ );
64
+ }
65
+
66
+ const createThemedStyles = (theme: Theme) =>
67
+ StyleSheet.create({
68
+ caption: {
69
+ color: theme.colors.onSurface,
70
+ },
71
+ placeholder: {
72
+ color: theme.colors.onSurface,
73
+ opacity: 0.6,
74
+ },
75
+ });
76
+
77
+ const styles = StyleSheet.create({
78
+ frame: {
79
+ width: "100%",
80
+ overflow: "hidden",
81
+ },
82
+ image: {
83
+ width: "100%",
84
+ height: 220,
85
+ },
86
+ placeholder: {
87
+ height: 160,
88
+ alignItems: "center",
89
+ justifyContent: "center",
90
+ },
91
+ caption: {
92
+ fontSize: 14,
93
+ opacity: 0.6,
94
+ paddingHorizontal: 16,
95
+ paddingVertical: 12,
96
+ },
97
+ captionBare: {
98
+ paddingHorizontal: 4,
99
+ paddingTop: 8,
100
+ paddingBottom: 0,
101
+ },
102
+ });
@@ -0,0 +1,31 @@
1
+ import type { ReactNode } from "react";
2
+ import { useWasto } from "../../contexts/WastoContext";
3
+ import { publicMediaUrl } from "../../helpers/publicMediaUrl";
4
+ import { ImageFrame } from "./ImageFrame";
5
+
6
+ export type ImageMediaProps = {
7
+ sourceType: "media";
8
+ mediaId: string;
9
+ alt?: string;
10
+ transparentBackground?: boolean;
11
+ showBorder?: boolean;
12
+ };
13
+
14
+ export function ImageMedia({
15
+ mediaId,
16
+ alt,
17
+ transparentBackground,
18
+ showBorder,
19
+ }: ImageMediaProps): ReactNode {
20
+ const { apiUrl } = useWasto();
21
+ const uri = publicMediaUrl(apiUrl, mediaId);
22
+
23
+ return (
24
+ <ImageFrame
25
+ uri={uri}
26
+ alt={alt}
27
+ transparentBackground={transparentBackground}
28
+ showBorder={showBorder}
29
+ />
30
+ );
31
+ }
@@ -0,0 +1,30 @@
1
+ import type { ReactNode } from "react";
2
+ import { ImageFrame } from "./ImageFrame";
3
+
4
+ export type ImageUrlProps = {
5
+ sourceType: "url";
6
+ url: string;
7
+ alt?: string;
8
+ transparentBackground?: boolean;
9
+ showBorder?: boolean;
10
+ };
11
+
12
+ export function ImageUrl({
13
+ url,
14
+ alt,
15
+ transparentBackground,
16
+ showBorder,
17
+ }: ImageUrlProps): ReactNode {
18
+ const trimmed = (url ?? "").trim();
19
+ const uri =
20
+ trimmed && trimmed !== "https://" && trimmed !== "http://" ? trimmed : null;
21
+
22
+ return (
23
+ <ImageFrame
24
+ uri={uri}
25
+ alt={alt}
26
+ transparentBackground={transparentBackground}
27
+ showBorder={showBorder}
28
+ />
29
+ );
30
+ }