import 'package:flutter/material.dart';

import 'package:design_system/design_system.dart';


/// Widget for displaying an empty state message, using design system tokens.
class EmptyStateWidget extends StatelessWidget {
  /// The message to display.
  final String message;
  /// Optional action link label.
  final String? actionLink;
  /// Optional action callback.
  final VoidCallback? onAction;

  /// Creates an [EmptyStateWidget].
  const EmptyStateWidget({super.key, required this.message, this.actionLink, this.onAction});

  @override
  Widget build(BuildContext context) {
    return Container(
      width: double.infinity,
      padding: const EdgeInsets.all(UiConstants.space4),
      decoration: BoxDecoration(
        color: UiColors.bgSecondary,
        borderRadius: BorderRadius.circular(UiConstants.radiusBase),
      ),
      alignment: Alignment.center,
      child: Column(
        children: [
          Text(
            message,
            style: UiTypography.body2r.copyWith(color: UiColors.mutedForeground),
          ),
          if (actionLink != null)
            GestureDetector(
              onTap: onAction,
              child: Padding(
                padding: const EdgeInsets.only(top: UiConstants.space2),
                child: Text(
                  actionLink!,
                  style: UiTypography.body2m.copyWith(color: UiColors.primary),
                ),
              ),
            ),
        ],
      ),
    );
  }
}
