import 'package:flutter/material.dart';
import '../../../core/app_theme.dart';
import 'user_guide_sheet.dart';

class GreetingSection extends StatelessWidget {
  final String userName;
  final String subtitle;

  const GreetingSection({
    super.key,
    required this.userName,
    this.subtitle = 'Selamat Datang di Kontrol Panel',
  });

  @override
  Widget build(BuildContext context) {
    return Row(
      crossAxisAlignment: CrossAxisAlignment.center,
      children: [
        Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Image.asset(
              'assets/images/logo_jamur.png',
              width: 48,
              height: 40,
              fit: BoxFit.contain,
            ),
            const SizedBox(height: 4),
            Text(
              'Halo, $userName!',
              style: const TextStyle(
                fontSize: 20,
                fontWeight: FontWeight.bold,
                color: AppTheme.textPrimary,
              ),
            ),
            Text(
              subtitle,
              style: const TextStyle(
                fontSize: 13,
                color: AppTheme.textSecondary,
              ),
            ),
          ],
        ),
        const Spacer(),
        IconButton(
          onPressed: () => UserGuideSheet.show(context),
          icon: const Icon(
            Icons.help_outline,
            size: 26,
            color: AppTheme.primary,
          ),
          tooltip: 'Petunjuk Penggunaan',
        ),
        const SizedBox(width: 8),
        CircleAvatar(
          radius: 24,
          backgroundColor: AppTheme.accentLight,
          child: const Icon(
            Icons.person,
            size: 26,
            color: AppTheme.accent,
          ),
        ),
      ],
    );
  }
}


