use std::time::Duration;

use crate::layout::Size;
use crate::select_option::SelectOption;
use crate::{RenderContext, Renderer};

pub fn test_renderer() -> Renderer<Vec<u8>> {
  Renderer::new(
    Vec::new(),
    Box::new(rand::rng()),
    RenderContext {
      terminal_size: Size {
        width: 80,
        height: 24,
      },
      elapsed: Duration::ZERO,
    },
  )
}

pub fn seeded_test_renderer(seed: u64) -> Renderer<Vec<u8>> {
  use rand::SeedableRng;
  use rand::rngs::SmallRng;
  Renderer::new(
    Vec::new(),
    Box::new(SmallRng::seed_from_u64(seed)),
    RenderContext {
      terminal_size: Size {
        width: 80,
        height: 24,
      },
      elapsed: Duration::ZERO,
    },
  )
}

pub fn select_option(label: &str, value: &str) -> SelectOption {
  SelectOption {
    label: label.to_string(),
    value: value.to_string(),
  }
}
