import { Component, OnInit, Input, ViewChild, ElementRef } from '@angular/core';
import { NGXLogger } from 'ngx-logger';
import { FileEventJson } from '@ucap-webmessenger/protocol-event';

@Component({
  selector: 'ucap-chat-message-box-image',
  templateUrl: './image.component.html',
  styleUrls: ['./image.component.scss']
})
export class ImageComponent implements OnInit {
  @Input()
  fileInfo: FileEventJson;
  @Input()
  expired = false;

  showExpired = false;

  constructor(private logger: NGXLogger) {}

  ngOnInit() {}

  mouseEnter(event: MouseEvent): void {
    if (this.expired) {
      this.showExpired = true;
    }
    event.stopPropagation();
    event.preventDefault();
  }
  mouseLeave(event: MouseEvent): void {
    if (this.expired) {
      this.showExpired = false;
    }
    event.stopPropagation();
    event.preventDefault();
  }
}
