()
| 40 | } |
| 41 | |
| 42 | render() { |
| 43 | if (this.state.hasError) { |
| 44 | return ( |
| 45 | <div className="flex flex-col items-center justify-center h-full gap-3 p-4 text-center"> |
| 46 | <AlertCircle className="h-10 w-10 text-muted-foreground" /> |
| 47 | <p className="font-medium text-foreground"> |
| 48 | Failed to render {this.props.viewerType || "file"} |
| 49 | </p> |
| 50 | <p className="text-sm text-muted-foreground max-w-[300px]"> |
| 51 | {this.state.error?.message || "An unexpected error occurred."} |
| 52 | </p> |
| 53 | <Button variant="outline" size="sm" onClick={this.handleReset}> |
| 54 | Try again |
| 55 | </Button> |
| 56 | </div> |
| 57 | ) |
| 58 | } |
| 59 | |
| 60 | return this.props.children |
| 61 | } |
| 62 | } |
no outgoing calls
no test coverage detected