feature: Doctor Feedback Mode
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { computed } from 'vue'
|
||||
import { useFeedbackStore } from '@/stores/feedback'
|
||||
|
||||
export function useFeedback(alertId) {
|
||||
const store = useFeedbackStore()
|
||||
|
||||
const feedback = computed(() => store.getFeedback(alertId))
|
||||
const hasRating = computed(() => !!feedback.value)
|
||||
const rating = computed(() => feedback.value?.rating ?? null)
|
||||
|
||||
function rate(alertType, severity, ratingValue, notes = '') {
|
||||
store.addFeedback(alertId, alertType, severity, ratingValue, notes)
|
||||
}
|
||||
|
||||
return { feedback, hasRating, rating, rate }
|
||||
}
|
||||
Reference in New Issue
Block a user