<script setup lang="ts">
import { RouterView } from 'vue-router';
import { NConfigProvider, NMessageProvider } from 'naive-ui';
import type { GlobalThemeOverrides } from 'naive-ui';
import { SelectProps, InputProps, TableProps } from 'naive-ui'

// type SelectThemeOverrides = NonNullable<SelectProps['themeOverrides']>
// type SelectThemeOverrides = NonNullable<InputProps['themeOverrides']>
const primaryColor = '#1A2029';

/**
 * @type import('naive-ui').GlobalThemeOverrides
 */
const themeOverrides: GlobalThemeOverrides = {
  common: {
    primaryColor: '#2454FF',
    primaryColorHover: '#2454FF',
    primaryColorPressed: '#2454FF',
    tableHeaderColor: '#F3F6F9',

  },
  Menu: {
    itemTextColor: primaryColor,
    itemTextColorActive: primaryColor,
    itemTextColorActiveHover: primaryColor,
    itemTextColorChildActiveHover: primaryColor,
    itemTextColorChildActive: primaryColor,
    itemColorActive: '#FCFDFE',
    itemColorActiveHover: '#FCFDFE',
    arrowColorChildActive: primaryColor
  },
  Scrollbar: {
    width: '0px',
  },
  Select: {
    peers: {
      InternalSelection: {
        textColor: '#5E5E5E',
        borderHover: '1px solid #2454FF',
        borderFocus: '1px solid #2454FF',
        placeholderColor: '#ccc',
        borderRadius: '8px'
      }
    },
  },
  Input: {
    border: '0px',
    borderHover: '0px ',
    borderFocus: '0px ',
    borderFocusWarning: '0px',
    boxShadowFocus: 'none',
    fontSizeMedium: '15px',
    textColor: '#1A2029',
    placeholderColor: 'rgba(158, 158, 158, 0.6)',
  },
  Tabs: {
    tabBorderColor: '#DAE5ED',
    tabFontSizeMedium: '12px',
    tabTextColorLine: '#272D35',
    tabFontWeightActive: 'bold'
  },
  LoadingBar: {
    colorLoading: '#000',
  },
  Button: {
    colorHoverPrimary: '#1D43CC',
    colorPressedPrimary: '#1D43CC',
    borderPressedPrimary: '#1D43CC',
  },
  DataTable: {
    // thTextColor: '#1A2029',
    // tdTextColor: primaryColor,
    // borderRadius: '4px',
    // borderColor: '#D7D7D7',
    // thPaddingMedium: '8px 10px',
    // tdPaddingMedium: '7px 10px',
    // fontSizeMedium: '11px'
  }
  // Menu: {
  //   itemTextColorHorizontal: '#161616',
  //   itemTextColorHoverHorizontal: '#2A68FF',
  //   itemTextColor: '#161616',
  //   itemColorHover: 'rgba(42, 104, 255, 0.1)',
  //   itemTextColorHover: '#2A68FF',
  // },
  // Pagination: {
  //   itemColorActiveHover: '#0092FF',
  //   itemColorActive: '0092FF',
  //   itemColor: "#f7f7f7",
  //   itemTextColorActive: '#fff',
  //   itemTextColorHover: '#fff',
  //   itemColorHover: '#0092FF',
  // }
}

</script>

<template>
  <NConfigProvider :theme-overrides="themeOverrides">
    <NMessageProvider>
      <RouterView />
    </NMessageProvider>
  </NConfigProvider>
</template>

<style scoped lang="scss">
header {
  @include flex(x, center, cetner);
  background: $el-bg-color;
  line-height: 1.5;
  max-height: 100vh;

  img {
    width: 200px;
  }
}

.logo {
  display: block;
  margin: 0 auto 2rem;
}

nav {
  width: 100%;
  font-size: 12px;
  text-align: center;
  margin-top: 2rem;
}

nav a.router-link-exact-active {
  color: var(--color-text);
}

nav a.router-link-exact-active:hover {
  background-color: transparent;
}

nav a {
  display: inline-block;
  padding: 0 1rem;
  border-left: 1px solid var(--color-border);
}

nav a:first-of-type {
  border: 0;
}

@media (min-width: 1024px) {
  header {
    display: flex;
    place-items: center;
    padding-right: calc(var(--section-gap) / 2);
  }

  .logo {
    margin: 0 2rem 0 0;
  }

  header .wrapper {
    display: flex;
    place-items: flex-start;
    flex-wrap: wrap;
  }

  nav {
    text-align: left;
    margin-left: -1rem;
    font-size: 1rem;

    padding: 1rem 0;
    margin-top: 1rem;
  }
}
</style>
