import 'package:design_system/design_system.dart';
import 'package:flutter/material.dart';
import 'package:staff_authentication/src/presentation/widgets/common/section_title_subtitle.dart';
import 'package:staff_authentication/staff_authentication.dart';

/// A widget for setting up basic profile information (photo, name, bio).
class ProfileSetupBasicInfo extends StatelessWidget {
  /// The user's full name.
  final String fullName;

  /// The user's bio.
  final String bio;

  /// Callback for when the full name changes.
  final ValueChanged<String> onFullNameChanged;

  /// Callback for when the bio changes.
  final ValueChanged<String> onBioChanged;

  /// Creates a [ProfileSetupBasicInfo] widget.
  const ProfileSetupBasicInfo({
    super.key,
    required this.fullName,
    required this.bio,
    required this.onFullNameChanged,
    required this.onBioChanged,
  });

  @override
  /// Builds the basic info step UI.
  Widget build(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: <Widget>[
        SectionTitleSubtitle(
          title: t.staff_authentication.profile_setup_page.basic_info.title,
          subtitle:
              t.staff_authentication.profile_setup_page.basic_info.subtitle,
        ),
        const SizedBox(height: UiConstants.space8),

        // Photo Upload
        Center(
          child: Stack(
            children: <Widget>[
              Container(
                width: 120,
                height: 120,
                decoration: BoxDecoration(
                  shape: BoxShape.circle,
                  color: UiColors.secondary,
                  border: Border.all(
                    color: UiColors.secondaryForeground.withAlpha(24),
                    width: 4,
                  ),
                ),
                child: const Icon(
                  UiIcons.user,
                  size: 48,
                  color: UiColors.iconSecondary,
                ),
              ),
              Positioned(
                bottom: 0,
                right: 0,
                child: UiIconButton.secondary(icon: UiIcons.camera),
              ),
            ],
          ),
        ),
        const SizedBox(height: UiConstants.space8),

        // Full Name
        UiTextField(
          label: t
              .staff_authentication
              .profile_setup_page
              .basic_info
              .full_name_label,
          hintText: t
              .staff_authentication
              .profile_setup_page
              .basic_info
              .full_name_hint,
          onChanged: onFullNameChanged,
        ),
        const SizedBox(height: UiConstants.space6),

        // Bio
        UiTextField(
          label: t.staff_authentication.profile_setup_page.basic_info.bio_label,
          hintText:
              t.staff_authentication.profile_setup_page.basic_info.bio_hint,
          maxLines: 3,
          onChanged: onBioChanged,
        ),
      ],
    );
  }
}
