import 'package:flutter/material.dart';

import 'package:get/get_state_manager/src/simple/get_view.dart';

import '../../../../core/constants/translation_keys.dart';
import '../../../../models/UserActivity.dart';
import '../../../../res/app_colors.dart';
import '../../controllers/user_activity_controller.dart';

class UserActivityWidget extends GetView<UserActivityController> {
  UserActivity userActivity;

  UserActivityWidget({required this.userActivity});

  @override
  Widget build(BuildContext context) {
    return Card(
      surfaceTintColor: Colors.white,
      child: Padding(
        padding: const EdgeInsets.all(12.0),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Text(userActivity.date.toString(),
                style: Theme.of(context).textTheme.bodyMedium),
            const SizedBox(
              height: 10,
            ),
            Text(userActivity.activity,
                style: Theme.of(context).textTheme.titleSmall),
            const SizedBox(
              height: 5,
            ),
            Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
              Text(
                  "${TranslationKeys.makeTranslation(TranslationKeys.textUserActivityChannel)}:  ${userActivity.channel}",
                  style: Theme.of(context).textTheme.bodyMedium),
              Text(
                  TranslationKeys.makeTranslation(
                      "${TranslationKeys.makeTranslation(TranslationKeys.textUserActivityDevice)}:  ${userActivity.deviceName}"),
                  style: Theme.of(context)
                      .textTheme
                      .bodyMedium
                      ?.copyWith(color: AppColors.minusColor)),
            ]),
          ],
        ),
      ),
    );
  }
}
