package com.example.shiftalarm

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.widget.Toast

class CancelAlarmReceiver : BroadcastReceiver() {
    override fun onReceive(context: Context, intent: Intent) {
        val alarmId = intent.getIntExtra("EXTRA_ALARM_ID", -1)
        val timeStr = intent.getStringExtra("EXTRA_TIME") ?: ""

        if (alarmId != -1) {
            NotificationHelper.dismissUpcomingNotification(context, alarmId)
            Toast.makeText(context, "오늘 $timeStr 알람이 해제되었습니다.", Toast.LENGTH_SHORT).show()
        }
    }
}
