import 'package:flutter/material.dart';
import 'package:trans_lark/generated/assets.dart';

class LanguageResultBar extends StatelessWidget {
  const LanguageResultBar({
    super.key,
    required this.fromLanguage,
    required this.toLanguage,
  });

  final String fromLanguage;
  final String toLanguage;

  @override
  Widget build(BuildContext context) {
    return Row(
      children: [
        Expanded(
          child: Padding(
            padding: const EdgeInsets.symmetric(vertical: 10),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.end,
              children: [
                const SizedBox(width: 8),
                Flexible(
                  child: Text(
                    fromLanguage,
                    style: const TextStyle(
                      color: Color(0xff435561),
                      fontSize: 14,
                      fontWeight: FontWeight.w500,
                      overflow: TextOverflow.ellipsis,
                    ),
                  ),
                ),
              ],
            ),
          ),
        ),
        const SizedBox(width: 20),
        Container(
          width: 26,
          height: 18,
          decoration: BoxDecoration(
            color: Colors.white,
            borderRadius: BorderRadius.circular(9),
          ),
          child: FittedBox(
            fit: BoxFit.none,
            child: Image.asset(
              Assets.imagesSwitchHomeIcon,
              width: 12,
              height: 12,
            ),
          ),
        ),
        const SizedBox(width: 20),
        Expanded(
          child: Padding(
            padding: const EdgeInsets.symmetric(vertical: 10),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.start,
              children: [
                const SizedBox(width: 8),
                Flexible(
                  child: Text(
                    toLanguage,
                    style: const TextStyle(
                      color: Color(0xff435561),
                      fontSize: 14,
                      fontWeight: FontWeight.w500,
                      overflow: TextOverflow.ellipsis,
                    ),
                  ),
                ),
              ],
            ),
          ),
        ),
      ],
    );
  }
}
