use dioxus::dioxus_core::{AttributeValue, IntoAttributeValue};
use serde::{Deserialize, Serialize};
use strum::{Display, EnumString};

#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Display, EnumString)]
pub enum Crossorigin {
    #[serde(rename = "anonymous")]
    #[strum(serialize = "anonymous")]
    Anonymous,

    #[serde(rename = "use-credentials")]
    #[strum(serialize = "use-credentials")]
    UseCredentials,
}

impl IntoAttributeValue for Crossorigin {
    fn into_value(self) -> AttributeValue {
        AttributeValue::Text(self.to_string())
    }
}
