// src/composables/useAlert.ts
import { inject } from 'vue';

export const useAlert = () => {
  const alert = inject('alert') as (
    message: string,
    type: 'success' | 'warning' | 'error' | 'info',
    duration?: number
  ) => void;
  if (!alert) {
    throw new Error('No alert provided!');
  }
  return alert;
};
