import 'package:boilerplate/core/i18n/translations.g.dart';
import 'package:boilerplate/core/styles/my_font.dart';
import 'package:boilerplate/presentation/widgets/ipm_html.dart';
import 'package:boilerplate/presentation/widgets/ipm_title_text.dart';
import 'package:flutter/material.dart';

import '../../../../../core/styles/my_dimensions.dart';
import '../../../../../domain/entities/product/product_data.dart';

class ProductAddress extends StatelessWidget {
  final ProductData data;
  const ProductAddress(this.data, {Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    if (data.address == null) {
      return Container();
    }

    return Container(
      padding: EdgeInsets.only(
        left: MyDimens.dimen16,
        right: MyDimens.dimen16,
        bottom: MyDimens.dimen16,
      ),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          IPMTitleText(
            title1: AppLocalizations.products.location_title_1,
            title2: AppLocalizations.products.location_title_2,
          ),
          IPMHtml(data.address!, ''),
        ],
      ),
    );
  }
}
