use yew::prelude::*;
#[derive(Properties, PartialEq)]
pub struct TooltipProps {
pub text: String,
}
#[function_component(Tooltip)]
pub fn tooltip(props: &TooltipProps) -> Html {
html! {
<span class="inline-flex items-center ml-1 group relative">
<svg
class="w-4 h-4 text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300 cursor-help transition-colors"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path
fill-rule="evenodd"
d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z"
clip-rule="evenodd"
/>
</svg>
<span class="invisible group-hover:visible absolute z-50 w-64 p-2 text-xs text-white bg-gray-900 dark:bg-gray-800 rounded shadow-lg -top-10 left-5 pointer-events-none">
{ &props.text }
<svg
class="absolute text-gray-900 dark:text-gray-800 h-2 w-full left-0 top-full"
x="0px"
y="0px"
viewBox="0 0 255 255"
>
<polygon class="fill-current" points="0,0 127.5,127.5 255,0"/>
</svg>
</span>
</span>
}
}