import 'package:flutter/material.dart';

import '../../../config/app_context.dart';

class Empty extends StatelessWidget {
  final String? title;
  final Widget? child;

  const Empty({super.key, this.title, this.child});

  @override
  Widget build(BuildContext context) {
    return SizedBox.expand(
      child: Align(
        alignment: const FractionalOffset(0.5, 0.2),
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            FractionallySizedBox(
              widthFactor: 0.5,
              child: Image.asset("assets/image/empty_data.png"),
            ),
            if (title != null)
              Text(
                title!,
                style: AppContext.textTheme.labelMedium,
              ),
            if (child != null) child!,
          ],
        ),
      ),
    );
  }
}
