import 'package:flutter/material.dart';

class ErrorView extends StatefulWidget {
  final String message;
  final String okMessage;
  final Function() onPressed;

  const ErrorView(
      {super.key,
      required this.message,
      required this.okMessage,
      required this.onPressed});

  @override
  State<ErrorView> createState() => _ErrorViewState();
}

class _ErrorViewState extends State<ErrorView> {
  @override
  Widget build(BuildContext context) {
    return Center(
      child: Column(
        children: [
          Text(widget.message),
          ElevatedButton(
              onPressed: widget.onPressed, child: Text(widget.okMessage))
        ],
      ),
    );
  }
}
