use yew::prelude::*;
use yew::services::ConsoleService;

use crate::container::*;
use crate::*;
pub struct Text {
    link: ComponentLink<Self>,
    props: Properties,
}
#[derive(Properties, Clone, Debug)]
pub struct Properties {
    #[prop_or_default]
    pub is: Elem,
    #[prop_or_default]
    pub children: Children,
    #[prop_or_default]
    pub hanging_punctauation: MultiValue<String>,
    #[prop_or_default]
    pub hyphens: String,
    #[prop_or_default]
    pub letter_spacing: Unit,
    #[prop_or_default]
    pub line_break: String,
}
impl Component for Text {
    type Message = ();
    type Properties = Properties;
    fn create(props: Self::Properties, link: ComponentLink<Self>) -> Self {
        Self { link, props }
    }
    fn update(&mut self, _: Self::Message) -> ShouldRender {
        true
    }
    fn change(&mut self, _: Self::Properties) -> ShouldRender {
        false
    }
    fn view(&self) -> Html {
        html!(
            <Container
                line_break=self.props.line_break.clone(),
                letter_spacing=self.props.letter_spacing.clone(),
                hyphens=self.props.hyphens.clone(),
                hanging_punctauation=self.props.hanging_punctauation.clone(),
                is=self.props.is.clone()>
                 {self.props.children.clone()}
            </Container>
        )
    }
}
