<script lang="ts" setup>
import { ref } from 'vue'
import Aside from './aside/Aside.vue'
import Content from './content/Content.vue'
import Robot from '@/components/Robot/index.vue'
import { useKeydown } from '@/hooks/event/useKeydown'

const contentRef: any = ref(null)

function showLoginModal() {
  contentRef.value.showLoginSuccessModal()
}
function closeLoginModal() {
  contentRef.value.closeLoginSuccessModal()
}
useKeydown('m m', showLoginModal)
useKeydown('enter', closeLoginModal)
</script>

<template>
  <div class="main">
    <!-- 侧边 -->
    <Aside />

    <!-- 内容 -->
    <Content ref="contentRef" />

    <!-- 机器人 -->
    <Robot :can-click="true" @click="showLoginModal" />
  </div>
</template>

<style lang="less" scoped>
.main {
  display: flex;
  flex-direction: row;
  box-sizing: border-box;
  width: 100%;
  margin-bottom: 16px
}
</style>
