import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
  connect() {
    setTimeout(() => {
      if (this.element) {
        this.element.style.opacity = '0'
        setTimeout(() => {
          this.element.remove()
        }, 300) // Remove after fade animation
      }
    }, 3000) // Start fading after 3 seconds
  }
}