import 'package:app/extensions/obtainProviderExtension.dart';
import 'package:flutter/material.dart';

import '../state/timeStatusState.dart';

class TimeWarningView extends StatelessWidget {
  const TimeWarningView({super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: BoxDecoration(
          color: Theme.of(context).colorScheme.surface
      ),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.center,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          const Center(
            child: Icon(
              Icons.warning_amber,
              size: 40,
            ),
          ),
          const VerticalDivider(
            endIndent: 20,
            indent: 20,
            color: Colors.white,
            thickness: 3,
            width: 40,
          ),
          const Column(
            mainAxisSize: MainAxisSize.min,
            children: [
              Text(
                "In Fußgängerzone?",
                style: TextStyle(fontSize: 20),
              ),
              Flexible(
                child: Text(
                  "hier ist der Konsum nur\nzwischen 20 und 7 Uhr gestattet!",
                  textAlign: TextAlign.center,
                ),
              ),
            ],
          ),
          Center(
            child: IconButton(
              onPressed: context.obtainState<TimeWarningState>().hide,
              icon: const Icon(Icons.close)
            ),
          )
        ],
      )
    );
  }
}
