refactor(ui): cleanup props usage
[e-mobility-charging-stations-simulator.git] / ui / web / src / components / actions / SetSupervisionUrl.vue
index f6ecab10e1ab3fd8917ddfddac7e18d6ddcb06db..2b7ef4a251a5b6c846a696da34038362f7e95147 100644 (file)
@@ -1,5 +1,6 @@
 <template>
-  <h2>Action Set Supervision Url</h2>
+  <h1 id="action">Action</h1>
+  <h2>Set Supervision Url</h2>
   <h3>Charging Station {{ chargingStationId }}</h3>
   <p>Supervision Url:</p>
   <input
   />
   <br />
   <Button
+    id="action-button"
     @click="
       () => {
         uiClient
-          .setSupervisionUrl(props.hashId, state.supervisionUrl)
+          .setSupervisionUrl(hashId, state.supervisionUrl)
           .then(() => {
             $toast.success('Supervision url successfully set')
           })
   >
     Set Supervision Url
   </Button>
-  <Button @click="$router.push({ name: 'charging-stations' })">Cancel</Button>
 </template>
 
 <script setup lang="ts">
-import { getCurrentInstance, reactive } from 'vue'
+import { getCurrentInstance, ref } from 'vue'
 import Button from '@/components/buttons/Button.vue'
 
-const props = defineProps<{
+defineProps<{
   hashId: string
   chargingStationId: string
 }>()
 
-const state = reactive({
+const state = ref({
   supervisionUrl: ''
 })