let setBannerVisible: (visible: boolean) => void;
let setBannerMessage: (message: string) => void;

export const initializeBanner = (
  setVisible: (visible: boolean) => void,
  setMessage: (message: string) => void
) => {
  setBannerVisible = setVisible;
  setBannerMessage = setMessage;
};

export const showBanner = (message: string) => {
  if (setBannerVisible && setBannerMessage) {
    setBannerMessage(message);
    setBannerVisible(true);
    setTimeout(() => {
      setBannerVisible(false);
    }, 3000);
  }
};
