import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:tm_app/core/utils/size_config.dart';
import 'package:tm_app/view_models/profile_view_model.dart';
import 'package:tm_app/views/shared/responsive_builder.dart';

import '../pages/d_profile_page.dart';
import '../pages/m_profile_page.dart';
import '../pages/t_profile_page.dart';

class ProfileScreen extends StatefulWidget {
  const ProfileScreen({super.key});

  @override
  State<ProfileScreen> createState() => _ProfileScreenState();
}

class _ProfileScreenState extends State<ProfileScreen> {
  late ProfileViewModel viewModel;

  @override
  void initState() {
    super.initState();
    viewModel = context.read<ProfileViewModel>();
    WidgetsBinding.instance.addPostFrameCallback((_) {
      viewModel.getCompanyProfile();
    });
  }

  @override
  Widget build(BuildContext context) {
    SizeConfig.init(context);
    return const ResponsiveBuilder(
      mobile: MobileProfilePage(),
      tablet: TabletProfilePage(),
      desktop: DesktopProfilePage(),
    );
  }
}
