import 'package:flutter/material.dart';

import '../../../common/theme/theme.dart';
import '../../../domain/outlet/outlet.dart';
import '../spaces/space.dart';

class OutletCard extends StatelessWidget {
  final Outlet outlet;
  final bool isSelected;
  const OutletCard({super.key, required this.outlet, required this.isSelected});

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 12.0),
      margin: EdgeInsets.only(bottom: 12),
      decoration: BoxDecoration(
        color: isSelected ? AppColor.primary.withOpacity(0.1) : AppColor.white,
        border: Border.all(color: AppColor.primary),
        borderRadius: const BorderRadius.all(Radius.circular(8.0)),
      ),
      child: Row(
        children: [
          Icon(Icons.store, color: AppColor.primary),
          SpaceWidth(12),
          Expanded(
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text(
                  outlet.name,
                  style: AppStyle.lg.copyWith(fontWeight: FontWeight.w600),
                ),
                Text(
                  outlet.address,
                  style: AppStyle.sm,
                  overflow: TextOverflow.ellipsis,
                  maxLines: 1,
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}
