import { Component } from '@angular/core';
import { IonHeader, IonToolbar, IonTitle, IonContent, IonSearchbar, IonIcon, IonTabs, IonLabel, IonTabButton, IonTabBar, IonCard, IonCardHeader, IonCardContent, IonCardTitle } from '@ionic/angular/standalone';
import { ExploreContainerComponent } from '../explore-container/explore-container.component';
import { EditTagComponent } from '../edit-tag/edit-tag.component'
import { EditRatingStarComponent } from '../edit-rating-star/edit-rating-star.component';
import { CompMarkmapComponent } from '../comp-markmap/comp-markmap.component';
import { CloudQuery } from 'src/lib/ncloud';

@Component({
  selector: 'app-tab2',
  templateUrl: 'tab2.page.html',
  styleUrls: ['tab2.page.scss'],
  standalone: true,
  imports: [IonHeader, IonToolbar, IonTitle, IonContent, ExploreContainerComponent,
    EditTagComponent, EditRatingStarComponent, IonSearchbar, IonIcon, IonTabs, IonLabel, IonTabButton, IonTabBar,
    CompMarkmapComponent,
    IonCard,IonCardHeader,IonCardContent,IonCardTitle
  ]
})
export class Tab2Page {

  async loadMapList(){
    let query = new CloudQuery("GoPlan");
    this.mapListOnline = await query.find();
  }
  mapListOnline:any = []
  mapList = [
    {title:"demo",content:` ---
markmap:
  maxWidth: 300
  colorFreezeLevel: 2
---

# markmap

## Links

- <https://markmap.js.org/>
- [GitHub](https://github.com/markmap/markmap)

## Related

- [coc-markmap](https://github.com/markmap/coc-markmap)
- [gatsby-remark-markmap](https://github.com/markmap/gatsby-remark-markmap)

## Features

- links
- **inline** ~~text~~ *styles*
- multiline
  text
- inline code
- Katex - $x = {-b \pm \sqrt{b^2-4ac} \over 2a}$
- This is a very very very very very very very very very very very very very very very long line.`},
    {title:"每日学习计划",content:`# 每日学习计划
## 时间
## 计划
## 总结      
      `},
      {title:"每周学习计划",content:`# 每周学习计划
## 时间
## 计划
## 总结        
        `}
  ]
  constructor() { 
    this.loadMapList();
  }

  currentScore: number = 0; // 初始分值

  handleScoreChange(newScore: number) {
    this.currentScore = newScore;
    console.log('新分值:', newScore); // 处理分值变化
  }
}
