<template>
  <router-view />
</template>

<script setup>
import { onMounted, onUnmounted } from 'vue'
import { useIPStore } from '@/stores/ipStore'

const ipStore = useIPStore()

onMounted(async () => {
  // Charger la configuration UI
  await ipStore.fetchUIConfig()

  // Charger les données initiales
  await ipStore.fetchIPs()

  // Connecter WebSocket
  ipStore.connectWebSocket()
})

onUnmounted(() => {
  // Déconnecter WebSocket
  ipStore.disconnectWebSocket()
})
</script>
