import 'package:flutter/material.dart';
import 'package:frontend_eccp_mobile/app/core/constants/constants.dart';
import 'package:frontend_eccp_mobile/modules/berkas/data/models/berkas_model.dart';
import 'package:shadcn_ui/shadcn_ui.dart';

class BerkasItemCard extends StatelessWidget {
  const BerkasItemCard({
    required this.item,
    super.key,
  });

  final BerkasModel item;

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: AppPadding.v16.add(AppPadding.h16),
      decoration: BoxDecoration(
        color: AppColors.neutralWhite,
        borderRadius: AppRadius.r8,
        boxShadow: AppShadows.sm,
      ),
      child: Row(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          const ShadAvatar(
            'https://sample.com/avatar-1.png',
            placeholder: Text('RS'),
          ),
          AppSpacing.w12,
          Expanded(child: _buildContent()),
        ],
      ),
    );
  }

  Widget _buildContent() {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        Text(
          item.title,
          style: AppTextStyles.small.copyWith(
            fontWeight: FontWeight.w700,
            color: AppColors.neutral900,
          ),
        ),
        AppSpacing.h2,
        Text(
          item.description,
          style: AppTextStyles.xs.copyWith(
            color: AppColors.neutral700,
          ),
        ),
      ],
    );
  }
}
