<script lang="ts" setup>
import { computed } from 'vue'
import ServiceTabLayout from '@/Components/Panel/ServiceTabLayout.vue'
import type { Service } from '@/types'

interface Props {
  service: Service
}

const props = defineProps<Props>()

const tabs = computed(() => [
  { label: 'Dashboard', icon: 'tabler-dashboard', to: `/services/${props.service.id}/dedicated-panel` },
  { label: 'Console', icon: 'tabler-terminal-2', to: `/services/${props.service.id}/dedicated-panel/console` },
  { label: 'Bandwidth', icon: 'tabler-chart-area-line', to: `/services/${props.service.id}/dedicated-panel/bandwidth` },
  { label: 'Network', icon: 'tabler-network', to: `/services/${props.service.id}/dedicated-panel/network` },
  { label: 'Reinstall', icon: 'tabler-reload', to: `/services/${props.service.id}/dedicated-panel/reinstall` },
  { label: 'Settings', icon: 'tabler-settings', to: `/services/${props.service.id}/dedicated-panel/settings` },
])
</script>

<template>
  <ServiceTabLayout
    :service="service"
    :tabs="tabs"
    :current-tab="`/services/${service.id}/dedicated-panel/settings`"
  >
    <VCard elevation="0">
      <VCardTitle class="d-flex align-center gap-2">
        <VIcon icon="tabler-settings" color="primary" />
        Server Settings
      </VCardTitle>
      <VCardText>
        <VRow>
          <VCol cols="12" md="6">
            <VTextField
              :model-value="service.hostname ?? ''"
              label="Hostname"
              variant="outlined"
              readonly
            />
          </VCol>
          <VCol cols="12" md="6">
            <VTextField
              :model-value="service.plan?.name ?? '--'"
              label="Current Plan"
              variant="outlined"
              readonly
            />
          </VCol>
        </VRow>

        <VAlert type="info" variant="tonal" class="mt-4">
          Server settings management requires SynergyCP API configuration.
          For advanced settings such as IPMI access and rescue mode, use the SynergyCP panel directly.
        </VAlert>
      </VCardText>
    </VCard>
  </ServiceTabLayout>
</template>
