File size: 942 Bytes
0914710
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<template>
  <button
    :class="`${props.class} bg-gray-200 bg-opacity-50`"
    :disabled="promptText.trim().length == 0 || responseMessage === waitingString"
    v-if="promptText.trim().length == 0 || responseMessage === waitingString"
  >{{ responseMessage === waitingString ? responseMessage : '🚫 Empty prompt (disabled)' }}
  </button>
  <button
    :class="`${props.class} bg-blue-300 whitespace-no-wrap overflow-hidden truncate`"
    @click="sendMLRequest(map, promptText, currentBaseMapName)"
    v-else
  >
    <span v-if="responseMessage && responseMessage != '-'">{{ responseMessage }}</span>
    <span v-else>send ML request 🔍</span>
  </button>
</template>

<script setup lang="ts">
import {Map as LMap} from 'leaflet';

const props = defineProps<{
  class: string,
  currentBaseMapName: string,
  promptText: string,
  responseMessage: string,
  map: LMap,
  sendMLRequest: Function,
  waitingString: string
}>()
</script>