use serde_json::Value;
use std::collections::HashMap;
use alchemy_styles::StylesList;
use crate::rsx::RSX;
#[derive(Clone, Debug)]
pub enum AttributeType {
Value(Value),
}
impl<'a> From<&'a str> for AttributeType {
fn from(f: &str) -> Self {
AttributeType::Value(Value::String(f.to_string()))
}
}
#[derive(Clone, Debug, Default)]
pub struct Props {
pub attributes: HashMap<&'static str, AttributeType>,
pub key: String,
pub styles: StylesList
}
impl Props {
pub fn new(
key: String,
styles: StylesList,
attributes: HashMap<&'static str, AttributeType>,
) -> Props {
Props {
attributes: attributes,
key: key,
styles: styles
}
}
pub fn get(&self, key: &str) -> Option<&AttributeType> {
match key {
"children" => { None },
"key" => { None },
"styles" => { None },
_ => { None } }
}
}