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

class EmptyStateView extends StatelessWidget {
  final IconData icon;
  final String title;
  final String subtitle;
  final String? actionLabel;
  final VoidCallback? onAction;

  const EmptyStateView({
    super.key,
    required this.icon,
    required this.title,
    required this.subtitle,
    this.actionLabel,
    this.onAction,
  });

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Padding(
        padding: const EdgeInsets.symmetric(vertical: 64),
        child: Column(
          children: [
            Container(
              width: UiConstants.space16,
              height: UiConstants.space16,
              decoration: BoxDecoration(
                color: UiColors.bgSecondary,
                borderRadius: UiConstants.radiusLg,
              ),
              child: Icon(icon, size: UiConstants.iconXl, color: UiColors.textSecondary),
            ),
            const SizedBox(height: UiConstants.space4),
            Text(
              title,
              style: UiTypography.body1m.textPrimary,
            ),
            const SizedBox(height: UiConstants.space1),
            Text(
              subtitle,
              style: UiTypography.body2r.textSecondary,
            ),
            if (actionLabel != null && onAction != null) ...[
              const SizedBox(height: UiConstants.space4),
              UiButton.primary(
                text: actionLabel!,
                onPressed: onAction,
              ),
            ],
          ],
        ),
      ),
    );
  }
}
