import 'package:flutter/material.dart';
import 'package:line_icons/line_icons.dart';

import '../../../../common/extension/extension.dart';
import '../../../../common/theme/theme.dart';
import '../../../../domain/auth/auth.dart';
import 'divider.dart';
import 'profile_tile.dart';

class ProfileAccountInfo extends StatelessWidget {
  final User user;
  const ProfileAccountInfo({super.key, required this.user});

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: EdgeInsets.symmetric(horizontal: AppValue.margin),
      decoration: BoxDecoration(
        color: AppColor.surface,
        borderRadius: BorderRadius.circular(12),
        boxShadow: [
          BoxShadow(
            color: Colors.black.withOpacity(0.05),
            blurRadius: 10,
            offset: const Offset(0, 2),
          ),
        ],
      ),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Padding(
            padding: EdgeInsets.all(16),
            child: Text(
              'Account Information',
              style: AppStyle.xl.copyWith(
                fontSize: 18,
                fontWeight: FontWeight.bold,
                color: AppColor.textPrimary,
              ),
            ),
          ),

          ProfileTile(
            icon: LineIcons.envelope,
            title: 'Email',
            subtitle: user.email,
            onTap: () {
              // Edit email
            },
          ),

          ProfileDivider(),

          ProfileTile(
            icon: LineIcons.calendarAlt,
            title: 'Member Since',
            subtitle: user.createdAt.toDate,
            showArrow: false,
          ),
        ],
      ),
    );
  }
}
