import 'dart:async';

import 'package:absensi_sas/app/constant.dart';
import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:intl/intl.dart';
import 'package:flutter_hooks/flutter_hooks.dart';

class RealTimeFormattedDate extends HookConsumerWidget {
  @override
  Widget build(BuildContext context, WidgetRef ref) {
    final currentTime = useState<DateTime>(DateTime.now());

    // Format waktu menjadi tanggal yang diinginkan
    String formattedDate =
        DateFormat('EEEE, d MMMM y', 'id_ID').format(currentTime.value);

    // Tampilkan widget Text dengan tanggal yang diformat
    return Text(
      formattedDate,
      style: Constant.date_600(context: context)
          .copyWith(color: Constant.textBlack),
    );
  }
}
