import 'package:flutter/material.dart';
import '../../../theme/ui_constants.dart';

/// 페이지 공통 좌우 패딩과 최대 폭을 보장하는 래퍼
class PageContainer extends StatelessWidget {
  final Widget child;
  final EdgeInsetsGeometry? padding;
  final double maxWidth;

  const PageContainer({
    super.key,
    required this.child,
    this.padding,
    this.maxWidth = 720,
  });

  @override
  Widget build(BuildContext context) {
    return Align(
      alignment: Alignment.topCenter,
      child: ConstrainedBox(
        constraints: BoxConstraints(maxWidth: maxWidth),
        child: Padding(
          padding: padding ??
              const EdgeInsets.symmetric(
                horizontal: UIConstants.pageHorizontalPadding,
              ),
          child: child,
        ),
      ),
    );
  }
}
