11import { useState , type ReactNode } from "react" ;
2- import { View } from "react-native" ;
2+ import { ActivityIndicator , View } from "react-native" ;
33
44import type { AppSymbolName } from "./AppSymbol" ;
55import { AppText as Text } from "./AppText" ;
@@ -14,6 +14,7 @@ export interface AndroidHeaderAction {
1414 readonly icon : AppSymbolName ;
1515 readonly onPress : ( ) => void ;
1616 readonly disabled ?: boolean ;
17+ readonly loading ?: boolean ;
1718 readonly selected ?: boolean ;
1819}
1920
@@ -84,16 +85,26 @@ export function AndroidScreenHeader(props: {
8485 ) : null }
8586 </ View >
8687
87- { visibleActions . map ( ( action ) => (
88- < AndroidHeaderIconButton
89- key = { action . accessibilityLabel }
90- accessibilityLabel = { action . accessibilityLabel }
91- disabled = { action . disabled }
92- selected = { action . selected }
93- icon = { action . icon }
94- onPress = { action . onPress }
95- />
96- ) ) }
88+ { visibleActions . map ( ( action ) =>
89+ action . loading ? (
90+ < View
91+ key = { action . accessibilityLabel }
92+ accessibilityLabel = { action . accessibilityLabel }
93+ className = "size-12 items-center justify-center"
94+ >
95+ < ActivityIndicator colorClassName = "accent-header-foreground" />
96+ </ View >
97+ ) : (
98+ < AndroidHeaderIconButton
99+ key = { action . accessibilityLabel }
100+ accessibilityLabel = { action . accessibilityLabel }
101+ disabled = { action . disabled }
102+ selected = { action . selected }
103+ icon = { action . icon }
104+ onPress = { action . onPress }
105+ />
106+ ) ,
107+ ) }
97108 { overflowActions . length > 0 ? (
98109 < AndroidAnchoredMenu
99110 actions = { overflowActions . map ( ( action , index ) => ( {
0 commit comments