corrad-bp/composables/useToast.js
Md Afiq Iskandar 316420282b Add form builder components and functionality
- Introduced `FormBuilderComponents.vue`, `FormBuilderCanvas.vue`, and `FormBuilderConfiguration.vue` for managing form elements.
- Added `ComponentPreview.vue` for rendering previews of form components.
- Implemented state management using Pinia in `stores/formBuilder.js` to handle form components and saved forms.
- Created pages for form builder interface (`index.vue`) and form management (`manage.vue`).
- Integrated toast notifications with `useToast.js` for user feedback.
- Documented the form builder structure and features in `FORM_BUILDER_DOCUMENTATION.md` and `FORM_BUILDER_TECHNICAL_APPENDIX.md`.
- Established a responsive layout and drag-and-drop functionality for a seamless user experience.
2025-04-09 12:18:50 +08:00

39 lines
802 B
JavaScript

import { useToast as useVueToast } from 'vue-toastification';
export const useToast = () => {
const toast = useVueToast();
return {
success: (message, options = {}) => {
toast.success(message, {
timeout: 3000,
position: 'top-right',
...options
});
},
error: (message, options = {}) => {
toast.error(message, {
timeout: 5000,
position: 'top-right',
...options
});
},
warning: (message, options = {}) => {
toast.warning(message, {
timeout: 4000,
position: 'top-right',
...options
});
},
info: (message, options = {}) => {
toast.info(message, {
timeout: 3000,
position: 'top-right',
...options
});
}
};
};