import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:tm_app/views/shared/responsive_builder.dart';

import '../../../view_models/tenders_view_model.dart';
import 'd_tenders_page.dart';
import 'm_tenders_page.dart';
import 't_tenders_page.dart';

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

  @override
  State<TendersScreen> createState() => _TendersScreenState();
}

class _TendersScreenState extends State<TendersScreen> {
  late final TendersViewModel viewModel;

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

  @override
  Widget build(BuildContext context) {
    return const ResponsiveBuilder(
      mobile: MobileTendersPage(),
      tablet: TabletTendersPage(),
      desktop: DesktopTendersPage(),
    );
  }
}
