perf(ui): use computed ref when possible
[e-mobility-charging-stations-simulator.git] / ui / web / src / components / charging-stations / CSTable.vue
index 3d9efbbf2471cb1239f3e64c51262923f8d45021..fc1f6a5cbb02ee4f550ca85dd347f9e6ce3b1b19 100644 (file)
     </thead>
     <tbody id="cs-table__body">
       <CSData
-        v-for="chargingStation in props.chargingStations"
-        :key="chargingStation.stationInfo?.hashId"
+        v-for="chargingStation in chargingStations"
+        :key="chargingStation.stationInfo.hashId"
         :charging-station="chargingStation"
-        :id-tag="props.idTag"
+        @need-refresh="$emit('need-refresh')"
       />
     </tbody>
   </table>
 import CSData from '@/components/charging-stations/CSData.vue'
 import type { ChargingStationData } from '@/types'
 
-const props = defineProps<{
+defineProps<{
   chargingStations: ChargingStationData[]
-  idTag: string
 }>()
+
+const $emit = defineEmits(['need-refresh'])
 </script>
 
 <style>
@@ -51,7 +52,6 @@ const props = defineProps<{
   empty-cells: show;
 }
 
-#cs-table__head,
 #cs-table__body {
   height: fit-content;
   width: 100%;
@@ -60,7 +60,7 @@ const props = defineProps<{
 }
 
 #cs-table__caption {
-  color: white;
+  color: ivory;
   background-color: black;
   font-size: 1.5rem;
   font-weight: bold;
@@ -71,12 +71,10 @@ const props = defineProps<{
   height: fit-content;
   width: 100%;
   display: flex;
+  flex-direction: row;
   justify-content: center;
   align-items: center;
-}
-
-#cs-table__head .cs-table__row {
-  background-color: lightgrey;
+  border: solid 0.25px black;
 }
 
 .cs-table__row:nth-of-type(even) {
@@ -85,13 +83,20 @@ const props = defineProps<{
 
 .cs-table__column {
   height: fit-content;
-  width: calc(65% / 10);
+  width: calc((100% - calc(100% / 3)) / 10);
+  display: flex;
+  flex-direction: column;
   text-align: center;
 }
 
+#cs-table__head .cs-table__row {
+  background-color: lightgrey;
+}
+
 .cs-table__connectors-column {
   height: fit-content;
-  width: 35%;
-  text-align: center;
+  width: calc(100% / 3);
+  display: flex;
+  flex-direction: column;
 }
 </style>