import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
import { useDatabaseStore } from './stores/database.js'

// 导入 Tailwind CSS
import './styles/tailwind.css'

const app = createApp(App)
const pinia = createPinia()

app.use(pinia)

// 初始化数据库
const initApp = async () => {
  const dbStore = useDatabaseStore()
  await dbStore.initialize()
  console.log('🚀 应用初始化完成')
}

app.mount('#app')

// 应用挂载后初始化数据库
initApp()
