use crate::database::read_rows;
use crate::types::NoteTypes;
use crate::utils::pretty_notes;
use chrono::NaiveDate;
pub async fn list(
conn: libsql::Connection,
limit: Option<u16>,
note_type: Option<NoteTypes>,
_today: bool,
_since: Option<NaiveDate>,
view: bool,
) -> Result<Vec<String>, Box<dyn std::error::Error>> {
let final_limit: u16 = limit.unwrap_or(15);
let notes = read_rows(conn, final_limit as i32, note_type).await?;
Ok(pretty_notes(notes, view))
}