import 'package:flutter/material.dart';
import 'package:fotodocumentation/pages/ui_utils/general_style.dart';
import 'package:fotodocumentation/utils/di_container.dart';

class PageHeaderWidget extends StatelessWidget {
  final String text;
  final String subText;

  const PageHeaderWidget({super.key, required this.text, this.subText = ""});

  GeneralStyle get _generalStyle => DiContainer.get();

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.only(top:24.0, bottom: 24.0),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Row(
            children: [
              Text(
                key: Key("PageHeaderTextHeadline"),
                text,
                style: TextStyle(
                  fontWeight: FontWeight.bold,
                  fontSize: 50,
                  fontFamily: _generalStyle.fontFamily,
                  color: _generalStyle.primaryTextLabelColor,
                ),
              ),
              const Spacer(),
              Image.asset(
                'assets/images/logo.png',
                height: 48,
              ),
            ],
          ),
          if (subText.isNotEmpty) ...[
            const SizedBox(height: 16),
            Text(
              key: Key("PageHeaderTextSubHeadline"),
              subText,
              style: TextStyle(
                fontSize: 16,
                fontFamily: _generalStyle.fontFamily,
                color: _generalStyle.secondaryTextLabelColor,
              ),
            ),
          ],
        ],
      ),
    );
  }
}
