import 'package:design_system/design_system.dart';
import 'package:flutter/material.dart';
import 'package:core_localization/core_localization.dart';

/// Widget displayed when there are no hubs.
class HubEmptyState extends StatelessWidget {

  /// Creates a [HubEmptyState].
  const HubEmptyState({required this.onAddPressed, super.key});
  /// Callback when the add button is pressed.
  final VoidCallback onAddPressed;

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.all(UiConstants.space8),
      decoration: BoxDecoration(
        color: UiColors.bgBanner,
        borderRadius: BorderRadius.circular(UiConstants.radiusBase),
        boxShadow: const <BoxShadow>[
          BoxShadow(
            color: UiColors.popupShadow,
            blurRadius: 10,
            offset: Offset(0, 4),
          ),
        ],
      ),
      child: Column(
        children: <Widget>[
          Container(
            width: 64,
            height: 64,
            decoration: const BoxDecoration(
              color: UiColors.secondary,
              shape: BoxShape.circle,
            ),
            child: const Icon(UiIcons.nfc, size: 32, color: UiColors.iconThird),
          ),
          const SizedBox(height: UiConstants.space4),
          Text(
            t.client_hubs.empty_state.title,
            style: UiTypography.title1m.textPrimary,
          ),
          const SizedBox(height: UiConstants.space2),
          Text(
            t.client_hubs.empty_state.description,
            textAlign: TextAlign.center,
            style: UiTypography.body2r.textSecondary,
          ),
          const SizedBox(height: UiConstants.space5),
          UiButton.primary(
            onPressed: onAddPressed,
            text: t.client_hubs.empty_state.button,
            leadingIcon: UiIcons.add,
          ),
        ],
      ),
    );
  }
}
