import 'package:flutter/material.dart';

class AddCardGeneric extends StatelessWidget {
  const AddCardGeneric(
      {super.key, required this.title, required this.description, this.action});

  final String title;
  final String description;
  final Function? action;

  @override
  Widget build(BuildContext context) {
    return Expanded(
        child: ListView(
            padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
            children: [
          Card.outlined(
              child: InkWell(
                  customBorder: RoundedRectangleBorder(
                    borderRadius: BorderRadius.circular(10),
                  ),
                  onTap: () {
                    if (action != null) {
                      action!();
                    }
                  },
                  child: ListTile(
                    contentPadding:
                        EdgeInsets.only(top: 5, left: 15, right: 5, bottom: 5),
                    autofocus: true,
                    leading: Icon(Icons.add_box_rounded),
                    title: Text(title),
                    subtitle: Text(description),
                  )))
        ]));
  }
}