import 'package:flutter/material.dart';
import 'package:test_sa/models/hospital.dart';
import 'package:test_sa/views/app_style/sizing.dart';

class HospitalItem extends StatelessWidget {
  final Hospital hospital;
  final Function(Hospital) onPressed;

  const HospitalItem({Key? key, required this.hospital, required this.onPressed}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 6),
      child: ElevatedButton(
        style: ElevatedButton.styleFrom(
          // backgroundColor: AColors.primaryColor,
          shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.circular(AppStyle.getBorderRadius(context)),
          ),
        ),
        onPressed: onPressed(hospital),
        child: ListTile(
          title: Text(
            hospital.name ?? "",
            // style: Theme.of(context).textTheme.subtitle1.copyWith(color: AColors.white),
            textDirection: TextDirection.rtl,
          ),
        ),
      ),
    );
  }
}
