import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:terepi_seged/pages/map_survey/presentations/controllers/map_survey_controller.dart';

import 'map_info_card.dart';
import 'format_menu_button.dart';
import 'coordinate_row.dart';

class Wgs84CoordinateCard extends StatelessWidget {
  final MapSurveyController controller;

  const Wgs84CoordinateCard({
    super.key,
    required this.controller,
  });

  @override
  Widget build(BuildContext context) {
    return Obx(() {
      return MapInfoCard(
        onClose: controller.toggleShowWgs84Card,
        title: Row(
          children: [
            const Icon(Icons.public, size: 18),
            const SizedBox(width: 6),
            Text(
              'WGS84',
              style: Theme.of(context).textTheme.titleSmall?.copyWith(
                    fontWeight: FontWeight.w700,
                  ),
            ),
            const Spacer(),
            FormatMenuButton(controller: controller),
          ],
        ),
        child: Column(
          children: [
            CoordinateRow(
              label: 'Lat',
              value: controller.latitudeText,
            ),
            const SizedBox(height: 1),
            CoordinateRow(
              label: 'Lon',
              value: controller.longitudeText,
            ),
          ],
        ),
      );
    });
  }
}
