use colored::Colorize;
use solana_client::rpc_client::RpcClient;
use solana_program::pubkey::Pubkey;
use tabled::{Alignment, Modify, Panel, Rotate, Style, Table};
use tabled::object::Segment;
use tabled::style::Color;
use common::command::{CliConfig, ProcessResult};
use common::contract::state::farming::mine::Rewarder;
pub fn process_farming_mine_rewarder_info(
rpc_client: &RpcClient,
_: &CliConfig,
rewarder: Pubkey,
) -> ProcessResult {
let info = Rewarder::get_info(rpc_client, &rewarder);
let color = Color::try_from(" ".cyan().to_string()).unwrap();
Ok(Table::new(vec![info])
.with(Rotate::Bottom)
.with(Rotate::Right)
.with(Style::modern())
.with(color)
.with(Panel("Rewarder Info", 0))
.with(Modify::new(Segment::all()).with(Alignment::center()))
.to_string())
}