import 'package:comwell_key_app/utils/l10n_utils.dart';
import 'package:comwell_key_app/utils/launch_util.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';

class CallUsSection extends StatelessWidget {
  const CallUsSection({
    super.key,
  });

  @override
  Widget build(BuildContext context) {
    final theme = Theme.of(context);
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        Text(
          context.strings.call_us,
          style: theme.textTheme.headlineMedium,
        ),
        const SizedBox(height: 8),
        Text(context.strings.call_us_description, style: theme.textTheme.bodySmall),
        const SizedBox(height: 16),
        Padding(
          padding: const EdgeInsets.symmetric(horizontal: 0),
          child: ElevatedButton(
            style: theme.elevatedButtonTheme.style?.copyWith(
              shape: WidgetStatePropertyAll(
                  RoundedRectangleBorder(
                      borderRadius: BorderRadius.circular(25))),
            ),
            onPressed: () async {
              await makePhoneCall(context.strings.comwell_telephone_number);
            },
            child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [
              Text(
                context.strings.call_us,
                style: theme.textTheme.headlineSmall?.copyWith(
                  color: Colors.white,
                ),
              ),
              const SizedBox(width: 8),
              SvgPicture.asset('assets/icons/phone_icon.svg')
            ]),
          ),
        )
      ],
    );
  }
}