import { ErrorInfo } from "react"
import { ScrollView, TextStyle, View, ViewStyle } from "react-native"
import { Button } from "@/components/Button"
import { Icon } from "@/components/Icon"
import { Screen } from "@/components/Screen"
import { Text } from "@/components/Text"
import { useAppTheme } from "@/theme/context"
import type { ThemedStyle } from "@/theme/types"
import { s } from "@/utils/responsive"
export interface ErrorDetailsProps {
error: Error
errorInfo: ErrorInfo | null
onReset(): void
}
/**
* Renders the error details screen.
* @param {ErrorDetailsProps} props - The props for the `ErrorDetails` component.
* @returns {JSX.Element} The rendered `ErrorDetails` component.
*/
export function ErrorDetails(props: ErrorDetailsProps) {
const { themed } = useAppTheme()
return (
)
}
const $contentContainer: ThemedStyle = ({ spacing }) => ({
alignItems: "center",
paddingHorizontal: spacing.lg,
paddingTop: spacing.xl,
flex: 1,
})
const $topSection: ViewStyle = {
flex: 1,
alignItems: "center",
}
const $heading: ThemedStyle = ({ colors, spacing }) => ({
color: colors.error,
marginBottom: spacing.md,
})
const $errorSection: ThemedStyle = ({ colors, spacing }) => ({
flex: 2,
backgroundColor: colors.separator,
marginVertical: spacing.md,
borderRadius: s(6),
})
const $errorSectionContentContainer: ThemedStyle = ({ spacing }) => ({
padding: spacing.md,
})
const $errorContent: ThemedStyle = ({ colors }) => ({
color: colors.error,
})
const $errorBacktrace: ThemedStyle = ({ colors, spacing }) => ({
marginTop: spacing.md,
color: colors.textDim,
})
const $resetButton: ThemedStyle = ({ colors, spacing }) => ({
backgroundColor: colors.error,
paddingHorizontal: spacing.xxl,
})