@@ -9,6 +9,7 @@ import PagerView from 'react-native-pager-view';
9
9
import Animated , { useAnimatedProps , useSharedValue } from 'react-native-reanimated' ;
10
10
import CarouselItem from '@components/Attachments/AttachmentCarousel/CarouselItem' ;
11
11
import useCarouselContextEvents from '@components/Attachments/AttachmentCarousel/useCarouselContextEvents' ;
12
+ import type { UseAttachmentErrors } from '@components/Attachments/AttachmentView/useAttachmentErrors' ;
12
13
import type { Attachment , AttachmentSource } from '@components/Attachments/types' ;
13
14
import useThemeStyles from '@hooks/useThemeStyles' ;
14
15
import shouldUseNewPager from '@libs/shouldUseNewPager' ;
@@ -55,10 +56,13 @@ type AttachmentCarouselPagerProps = {
55
56
56
57
/** The reportID related to the attachment */
57
58
reportID ?: string ;
59
+
60
+ /** Optional property providing methods to manage error states for attachments. */
61
+ attachmentErrors ?: UseAttachmentErrors ;
58
62
} ;
59
63
60
64
function AttachmentCarouselPager (
61
- { items, activeAttachmentID, initialPage, setShouldShowArrows, onPageSelected, onClose, reportID} : AttachmentCarouselPagerProps ,
65
+ { items, activeAttachmentID, initialPage, setShouldShowArrows, onPageSelected, onClose, reportID, attachmentErrors } : AttachmentCarouselPagerProps ,
62
66
ref : ForwardedRef < AttachmentCarouselPagerHandle > ,
63
67
) {
64
68
const { handleTap, handleScaleChange, isScrollEnabled} = useCarouselContextEvents ( setShouldShowArrows ) ;
@@ -100,8 +104,9 @@ function AttachmentCarouselPager(
100
104
onTap : handleTap ,
101
105
onSwipeDown : onClose ,
102
106
onScaleChanged : handleScaleChange ,
107
+ attachmentErrors,
103
108
} ) ,
104
- [ pagerItems , activePageIndex , isPagerScrolling , isScrollEnabled , handleTap , onClose , handleScaleChange ] ,
109
+ [ pagerItems , activePageIndex , isPagerScrolling , isScrollEnabled , handleTap , onClose , handleScaleChange , attachmentErrors ] ,
105
110
) ;
106
111
107
112
const animatedProps = useAnimatedProps ( ( ) => ( {
0 commit comments