import { h } from '@/h';
import '@build/tailwind/main.css';
// tab的app-routes模块
// import './tab';
import './app.ts';
import { start } from '@kevisual/tab-leader';
import './page/index.css';
import './main.css';

import { Page } from '@kevisual/store/page';
import { AiChat } from './page/AiChat';

const main = () => {
  start();
};
main();

const page = new Page({
  path: '',
  key: '',
  basename: '',
});

page.addPage('/', 'home');
page.addPage('/ai', 'ai');

page.subscribe('home', (page) => {
  const div = document.createElement('div');

  div.className = 'text-4xl text-center p-4 bg-blue-200';
  div.innerHTML = 'Browser Apps';

  document.body.appendChild(div);
});

page.subscribe('ai', (page) => {
  const aiChat = AiChat();
  console.log(aiChat);
  document.body.appendChild(aiChat);
});
