import { Injectable } from '@angular/core';

import {
  MatSnackBar,
  MatSnackBarConfig,
  MatSnackBarRef,
  SimpleSnackBar
} from '@angular/material';

@Injectable({
  providedIn: 'root'
})
export class SnackBarService {
  public constructor(private matSnackBar: MatSnackBar) {}

  public open(
    message: string,
    action?: string,
    config?: MatSnackBarConfig
  ): MatSnackBarRef<SimpleSnackBar> {
    return this.matSnackBar.open(message, action, config);
  }
}
