@@ -9,24 +9,24 @@ import type { ApiPoi } from '~/lib/apiPois'
9
9
import { mapStore as useMapStore } from ' ~/stores/map'
10
10
import { favoriteStore as useFavoriteStore } from ' ~/stores/favorite'
11
11
12
- const props = defineProps <{
13
- exploreAroundSelectedPoi: Function
14
- goToSelectedPoi: Function
15
- toggleFavorite: Function
12
+ const emit = defineEmits <{
13
+ (e : ' exploreClick' , poi : ApiPoi ): void
14
+ (e : ' favoriteClick' , poi : ApiPoi ): void
15
+ (e : ' toggleFavoriteMode' ): void
16
+ (e : ' toggleNoteBookMode' ): void
17
+ (e : ' zoomClick' , poi : ApiPoi ): void
16
18
}>()
17
19
18
- const emit = defineEmits ([' toggleFavoriteMode' , ' toggleNoteBookMode' ])
19
-
20
20
const device = useDevice ()
21
21
const notebookModal = ref <boolean >(false )
22
22
23
23
const mapStore = useMapStore ()
24
24
const { isModeFavorites } = storeToRefs (mapStore )
25
25
const { favoriteCount } = storeToRefs (useFavoriteStore ())
26
26
27
- function explore (poi : ApiPoi ) {
27
+ function onExploreClick (poi : ApiPoi ) {
28
28
notebookModal .value = false
29
- props . exploreAroundSelectedPoi ( poi )
29
+ emit ( ' exploreClick ' , poi )
30
30
}
31
31
32
32
function onClose() {
@@ -35,13 +35,8 @@ function onClose() {
35
35
}
36
36
37
37
function onZoomClick(poi : ApiPoi ) {
38
- mapStore .setSelectedFeature (poi )
39
38
notebookModal .value = false
40
- props .goToSelectedPoi (poi )
41
- }
42
-
43
- function handleFavorite(poi : ApiPoi ) {
44
- props .toggleFavorite (poi )
39
+ emit (' zoomClick' , poi )
45
40
}
46
41
47
42
const { $tracking } = useNuxtApp ()
@@ -107,8 +102,8 @@ async function toggleNoteBookMode() {
107
102
max-width =" 80rem"
108
103
>
109
104
<FavoriteNoteBook
110
- @explore-click =" explore "
111
- @favorite-click =" handleFavorite "
105
+ @explore-click =" onExploreClick "
106
+ @favorite-click =" $emit('favoriteClick', $event) "
112
107
@zoom-click =" onZoomClick"
113
108
@on-close =" onClose"
114
109
/>
0 commit comments