<template>
  <div class="seting">
    <div class="seting-title">
      个人资料
    </div>
    <div class="seting-content">
      <n-tabs
        type="line"
        animated
        justify-content="center"
      >
        <n-tab-pane
          name="user"
          tab="账户信息"
        >
          <n-upload
            action="#"
            :max="1"
            :show-file-list="false"
          >
            <n-image
              width="100%"
              height="200px"
              :preview-disabled="true"
              :src="userData.url"
            />
          </n-upload>
          <n-form>
            <n-form-item label="名称">
              <n-input
                v-model:value="userData.name"
                placeholder="称呼"
              />
            </n-form-item>
          </n-form>
        </n-tab-pane>
        <n-tab-pane
          name="pass"
          tab="更改密码"
        >
          <n-form>
            <n-form-item label="原密码">
              <n-input />
            </n-form-item>
            <n-form-item label="新密码">
              <n-input />
            </n-form-item>
            <n-form-item label="重复新密码">
              <n-input />
            </n-form-item>
          </n-form>
        </n-tab-pane>
      </n-tabs>
    </div>
    <div class="seting-bar">
      <span>编辑你的账号信息</span>
      <n-button type="warning">
        更新
      </n-button>
    </div>
  </div>
</template>

<script setup lang='ts'>
import { ref } from 'vue'

const userData = ref({
  url: new URL('@/assets/icons/3.svg', import.meta.url).href,
  name: ''
})
</script>
<style lang="scss" scoped>
.seting {
  padding: 40px 4% 0 4%;
  min-width: 327px;
  height: 100%;

  &-title {
    font-size: 18px;
  }

  &-content {
    height: calc(100% - 75px);
    text-align: center;
    padding: 0 5%;

    :deep(.n-tabs) {
      --n-pane-padding-top: 20px;
    }

    :deep(.n-tabs-tab) {
      padding-left: 20px;
      padding-right: 20px;
    }

    :deep(.n-form) {
      min-width: 300px;
      max-width: 50%;
      margin: 0 auto;
    }
  }

  &-bar {
    width: 100%;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;

    :deep(.n-button) {
      --n-width: 30%;
      max-width: 200px;
      --n-border-radius: 10px;
    }
  }
}
</style>