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

import '../../../components/button/button.dart';
import '../../../router/app_router.gr.dart';
import 'widgets/name_field.dart';
import 'widgets/phone_field.dart';

@RoutePage()
class RegisterPage extends StatelessWidget {
  const RegisterPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Masuk')),
      body: Padding(
        padding: const EdgeInsets.symmetric(horizontal: 24.0),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            const SizedBox(height: 40),

            // Title
            RegisterPhoneField(),
            SizedBox(height: 24),
            RegisterNameField(),

            const SizedBox(height: 50),

            Spacer(),

            // Continue Button
            AppElevatedButton(
              onPressed: () => context.router.push(const OtpRoute()),
              title: 'Daftar & Lanjutkan',
            ),

            const SizedBox(height: 24),
          ],
        ),
      ),
    );
  }
}
