use std::fmt::Display;
use std::marker::PhantomData;
use std::str::FromStr;
use derivative::Derivative;
use yew::prelude::*;
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
pub struct RadioListItem<T> {
_typeref: PhantomData<T>,
}
#[derive(Properties, PartialEq)]
pub struct RadioListItemProps<T>
where
T: Clone + Display + FromStr + PartialEq + 'static,
{
pub children: Children,
pub value: T,
}
impl<T> Component for RadioListItem<T>
where
T: Clone + Display + FromStr + PartialEq + 'static,
{
type Message = ();
type Properties = RadioListItemProps<T>;
fn create(_ctx: &Context<Self>) -> Self {
Self::default()
}
fn view(&self, ctx: &Context<Self>) -> Html {
ctx.props().children.iter().collect::<Html>()
}
}