import {View, ActivityIndicator, ViewStyle, TextStyle} from "react-native"
import {Text} from "@/components/ignite"
import {useAppTheme} from "@/contexts/ThemeContext"
import {ThemedStyle} from "@/theme"
interface LoadingOverlayProps {
message?: string
}
/**
* A consistent loading overlay component to be used across the app
* for loading states, especially during transitions between screens.
*/
const LoadingOverlay = ({message = "Loading..."}: LoadingOverlayProps) => {
const {themed, theme} = useAppTheme()
return (
)
}
const $container: ThemedStyle = ({colors}) => ({
alignItems: "center",
bottom: 0,
justifyContent: "center",
left: 0,
position: "absolute",
right: 0,
top: 0,
zIndex: 1000,
backgroundColor: colors.background,
})
const $contentContainer: ThemedStyle = () => ({
alignItems: "center",
borderRadius: 10,
justifyContent: "center",
padding: 20,
})
const $message: ThemedStyle = ({colors}) => ({
fontSize: 16,
fontWeight: "500",
textAlign: "center",
color: colors.text,
})
const $spinner: ThemedStyle = () => ({
marginBottom: 12,
})
export default LoadingOverlay