303 lines
10 KiB
Rust
303 lines
10 KiB
Rust
use leptos::prelude::*;
|
|
|
|
#[derive(Copy, Debug, Clone)]
|
|
pub enum Icon {
|
|
BoltSolid,
|
|
BoltSlashSolid,
|
|
WrenchSolid,
|
|
ForwardSolid,
|
|
Check,
|
|
Heart,
|
|
HeartOutline,
|
|
ArrowPath,
|
|
PaperAirplaneSolid,
|
|
NoSymbol,
|
|
Trophy,
|
|
ArrowTrendingUp,
|
|
ChevronLeft,
|
|
ChevronRight,
|
|
CodeBracketSquare,
|
|
}
|
|
impl Icon {
|
|
// TODO: Actually impl IntoView for Icon instead
|
|
pub fn into_view(self) -> impl IntoView {
|
|
match self {
|
|
Icon::BoltSolid => view! { <BoltSolid /> }.into_any(),
|
|
Icon::BoltSlashSolid => view! { <BoltSlashSolid /> }.into_any(),
|
|
Icon::WrenchSolid => view! { <WrenchSolid /> }.into_any(),
|
|
Icon::ForwardSolid => view! { <ForwardSolid /> }.into_any(),
|
|
Icon::Check => view! { <Check /> }.into_any(),
|
|
Icon::Heart => view! { <Heart /> }.into_any(),
|
|
Icon::HeartOutline => view! { <HeartOutline /> }.into_any(),
|
|
Icon::ArrowPath => view! { <ArrowPath /> }.into_any(),
|
|
Icon::PaperAirplaneSolid => view! { <PaperAirplaneSolid /> }.into_any(),
|
|
Icon::NoSymbol => view! { <NoSymbol /> }.into_any(),
|
|
Icon::Trophy => view! { <Trophy /> }.into_any(),
|
|
Icon::ArrowTrendingUp => view! { <ArrowTrendingUp /> }.into_any(),
|
|
Icon::ChevronLeft => view! { <ChevronLeft /> }.into_any(),
|
|
Icon::ChevronRight => view! { <ChevronRight /> }.into_any(),
|
|
Icon::CodeBracketSquare => view! { <CodeBracketSquare /> }.into_any(),
|
|
}
|
|
}
|
|
}
|
|
|
|
#[component]
|
|
pub fn BoltSolid() -> impl IntoView {
|
|
view! {
|
|
<svg
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
viewBox="0 0 24 24"
|
|
fill="currentColor"
|
|
class="size-6"
|
|
>
|
|
<path
|
|
fill-rule="evenodd"
|
|
d="M14.615 1.595a.75.75 0 0 1 .359.852L12.982 9.75h7.268a.75.75 0 0 1 .548 1.262l-10.5 11.25a.75.75 0 0 1-1.272-.71l1.992-7.302H3.75a.75.75 0 0 1-.548-1.262l10.5-11.25a.75.75 0 0 1 .913-.143Z"
|
|
clip-rule="evenodd"
|
|
/>
|
|
</svg>
|
|
}
|
|
}
|
|
|
|
#[component]
|
|
pub fn BoltSlashSolid() -> impl IntoView {
|
|
view! {
|
|
<svg
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
viewBox="0 0 24 24"
|
|
fill="currentColor"
|
|
class="size-6"
|
|
>
|
|
<path d="m20.798 11.012-3.188 3.416L9.462 6.28l4.24-4.542a.75.75 0 0 1 1.272.71L12.982 9.75h7.268a.75.75 0 0 1 .548 1.262ZM3.202 12.988 6.39 9.572l8.148 8.148-4.24 4.542a.75.75 0 0 1-1.272-.71l1.992-7.302H3.75a.75.75 0 0 1-.548-1.262ZM3.53 2.47a.75.75 0 0 0-1.06 1.06l18 18a.75.75 0 1 0 1.06-1.06l-18-18Z" />
|
|
</svg>
|
|
}
|
|
}
|
|
|
|
#[component]
|
|
pub fn WrenchSolid() -> impl IntoView {
|
|
view! {
|
|
<svg
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
viewBox="0 0 24 24"
|
|
fill="currentColor"
|
|
class="size-6"
|
|
>
|
|
<path
|
|
fill-rule="evenodd"
|
|
d="M12 6.75a5.25 5.25 0 0 1 6.775-5.025.75.75 0 0 1 .313 1.248l-3.32 3.319c.063.475.276.934.641 1.299.365.365.824.578 1.3.64l3.318-3.319a.75.75 0 0 1 1.248.313 5.25 5.25 0 0 1-5.472 6.756c-1.018-.086-1.87.1-2.309.634L7.344 21.3A3.298 3.298 0 1 1 2.7 16.657l8.684-7.151c.533-.44.72-1.291.634-2.309A5.342 5.342 0 0 1 12 6.75ZM4.117 19.125a.75.75 0 0 1 .75-.75h.008a.75.75 0 0 1 .75.75v.008a.75.75 0 0 1-.75.75h-.008a.75.75 0 0 1-.75-.75v-.008Z"
|
|
clip-rule="evenodd"
|
|
/>
|
|
</svg>
|
|
}
|
|
}
|
|
|
|
#[component]
|
|
pub fn ForwardSolid() -> impl IntoView {
|
|
view! {
|
|
<svg
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
viewBox="0 0 24 24"
|
|
fill="currentColor"
|
|
class="size-6"
|
|
>
|
|
<path d="M5.055 7.06C3.805 6.347 2.25 7.25 2.25 8.69v8.122c0 1.44 1.555 2.343 2.805 1.628L12 14.471v2.34c0 1.44 1.555 2.343 2.805 1.628l7.108-4.061c1.26-.72 1.26-2.536 0-3.256l-7.108-4.061C13.555 6.346 12 7.249 12 8.689v2.34L5.055 7.061Z" />
|
|
</svg>
|
|
}
|
|
}
|
|
|
|
#[component]
|
|
pub fn Check() -> impl IntoView {
|
|
view! {
|
|
<svg
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
viewBox="0 0 24 24"
|
|
fill="currentColor"
|
|
class="size-6"
|
|
>
|
|
<path
|
|
fill-rule="evenodd"
|
|
stroke="currentColor"
|
|
stroke-width="2"
|
|
d="M19.916 4.626a.75.75 0 0 1 .208 1.04l-9 13.5a.75.75 0 0 1-1.154.114l-6-6a.75.75 0 0 1 1.06-1.06l5.353 5.353 8.493-12.74a.75.75 0 0 1 1.04-.207Z"
|
|
clip-rule="evenodd"
|
|
/>
|
|
</svg>
|
|
}
|
|
}
|
|
|
|
#[component]
|
|
pub fn Heart() -> impl IntoView {
|
|
view! {
|
|
<svg
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
viewBox="0 0 24 24"
|
|
fill="currentColor"
|
|
class="size-6"
|
|
>
|
|
<path d="m11.645 20.91-.007-.003-.022-.012a15.247 15.247 0 0 1-.383-.218 25.18 25.18 0 0 1-4.244-3.17C4.688 15.36 2.25 12.174 2.25 8.25 2.25 5.322 4.714 3 7.688 3A5.5 5.5 0 0 1 12 5.052 5.5 5.5 0 0 1 16.313 3c2.973 0 5.437 2.322 5.437 5.25 0 3.925-2.438 7.111-4.739 9.256a25.175 25.175 0 0 1-4.244 3.17 15.247 15.247 0 0 1-.383.219l-.022.012-.007.004-.003.001a.752.752 0 0 1-.704 0l-.003-.001Z" />
|
|
</svg>
|
|
}
|
|
}
|
|
|
|
#[component]
|
|
pub fn HeartOutline() -> impl IntoView {
|
|
view! {
|
|
<svg
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
fill="none"
|
|
viewBox="0 0 24 24"
|
|
stroke-width="1.5"
|
|
stroke="currentColor"
|
|
class="size-6"
|
|
>
|
|
<path
|
|
stroke-linecap="round"
|
|
stroke-linejoin="round"
|
|
d="M21 8.25c0-2.485-2.099-4.5-4.688-4.5-1.935 0-3.597 1.126-4.312 2.733-.715-1.607-2.377-2.733-4.313-2.733C5.1 3.75 3 5.765 3 8.25c0 7.22 9 12 9 12s9-4.78 9-12Z"
|
|
/>
|
|
</svg>
|
|
}
|
|
}
|
|
|
|
#[component]
|
|
pub fn ArrowPath() -> impl IntoView {
|
|
view! {
|
|
<svg
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
viewBox="0 0 24 24"
|
|
fill="currentColor"
|
|
class="size-6"
|
|
>
|
|
<path
|
|
fill-rule="evenodd"
|
|
d="M4.755 10.059a7.5 7.5 0 0 1 12.548-3.364l1.903 1.903h-3.183a.75.75 0 1 0 0 1.5h4.992a.75.75 0 0 0 .75-.75V4.356a.75.75 0 0 0-1.5 0v3.18l-1.9-1.9A9 9 0 0 0 3.306 9.67a.75.75 0 1 0 1.45.388Zm15.408 3.352a.75.75 0 0 0-.919.53 7.5 7.5 0 0 1-12.548 3.364l-1.902-1.903h3.183a.75.75 0 0 0 0-1.5H2.984a.75.75 0 0 0-.75.75v4.992a.75.75 0 0 0 1.5 0v-3.18l1.9 1.9a9 9 0 0 0 15.059-4.035.75.75 0 0 0-.53-.918Z"
|
|
clip-rule="evenodd"
|
|
/>
|
|
</svg>
|
|
}
|
|
}
|
|
|
|
#[component]
|
|
pub fn PaperAirplaneSolid() -> impl IntoView {
|
|
view! {
|
|
<svg
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
viewBox="0 0 24 24"
|
|
fill="currentColor"
|
|
class="size-6"
|
|
>
|
|
<path d="M3.478 2.404a.75.75 0 0 0-.926.941l2.432 7.905H13.5a.75.75 0 0 1 0 1.5H4.984l-2.432 7.905a.75.75 0 0 0 .926.94 60.519 60.519 0 0 0 18.445-8.986.75.75 0 0 0 0-1.218A60.517 60.517 0 0 0 3.478 2.404Z" />
|
|
</svg>
|
|
}
|
|
}
|
|
|
|
#[component]
|
|
pub fn NoSymbol() -> impl IntoView {
|
|
view! {
|
|
<svg
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
viewBox="0 0 24 24"
|
|
fill="currentColor"
|
|
class="size-6"
|
|
>
|
|
<path
|
|
fill-rule="evenodd"
|
|
d="m6.72 5.66 11.62 11.62A8.25 8.25 0 0 0 6.72 5.66Zm10.56 12.68L5.66 6.72a8.25 8.25 0 0 0 11.62 11.62ZM5.105 5.106c3.807-3.808 9.98-3.808 13.788 0 3.808 3.807 3.808 9.98 0 13.788-3.807 3.808-9.98 3.808-13.788 0-3.808-3.807-3.808-9.98 0-13.788Z"
|
|
clip-rule="evenodd"
|
|
/>
|
|
</svg>
|
|
}
|
|
}
|
|
|
|
#[component]
|
|
pub fn Trophy() -> impl IntoView {
|
|
view! {
|
|
<svg
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
fill="none"
|
|
viewBox="0 0 24 24"
|
|
stroke-width="1.5"
|
|
stroke="currentColor"
|
|
class="size-6"
|
|
>
|
|
<path
|
|
stroke-linecap="round"
|
|
stroke-linejoin="round"
|
|
d="M16.5 18.75h-9m9 0a3 3 0 0 1 3 3h-15a3 3 0 0 1 3-3m9 0v-3.375c0-.621-.503-1.125-1.125-1.125h-.871M7.5 18.75v-3.375c0-.621.504-1.125 1.125-1.125h.872m5.007 0H9.497m5.007 0a7.454 7.454 0 0 1-.982-3.172M9.497 14.25a7.454 7.454 0 0 0 .981-3.172M5.25 4.236c-.982.143-1.954.317-2.916.52A6.003 6.003 0 0 0 7.73 9.728M5.25 4.236V4.5c0 2.108.966 3.99 2.48 5.228M5.25 4.236V2.721C7.456 2.41 9.71 2.25 12 2.25c2.291 0 4.545.16 6.75.47v1.516M7.73 9.728a6.726 6.726 0 0 0 2.748 1.35m8.272-6.842V4.5c0 2.108-.966 3.99-2.48 5.228m2.48-5.492a46.32 46.32 0 0 1 2.916.52 6.003 6.003 0 0 1-5.395 4.972m0 0a6.726 6.726 0 0 1-2.749 1.35m0 0a6.772 6.772 0 0 1-3.044 0"
|
|
/>
|
|
</svg>
|
|
}
|
|
}
|
|
|
|
#[component]
|
|
pub fn ArrowTrendingUp() -> impl IntoView {
|
|
view! {
|
|
<svg
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
fill="none"
|
|
viewBox="0 0 24 24"
|
|
stroke-width="1.5"
|
|
stroke="currentColor"
|
|
class="size-6"
|
|
>
|
|
<path
|
|
stroke-linecap="round"
|
|
stroke-linejoin="round"
|
|
d="M2.25 18 9 11.25l4.306 4.306a11.95 11.95 0 0 1 5.814-5.518l2.74-1.22m0 0-5.94-2.281m5.94 2.28-2.28 5.941"
|
|
/>
|
|
</svg>
|
|
}
|
|
}
|
|
|
|
#[component]
|
|
pub fn ChevronLeft() -> impl IntoView {
|
|
view! {
|
|
<svg
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
fill="none"
|
|
viewBox="0 0 24 24"
|
|
stroke-width="1.5"
|
|
stroke="currentColor"
|
|
class="size-6"
|
|
>
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 19.5 8.25 12l7.5-7.5" />
|
|
</svg>
|
|
}
|
|
}
|
|
|
|
#[component]
|
|
pub fn ChevronRight() -> impl IntoView {
|
|
view! {
|
|
<svg
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
fill="none"
|
|
viewBox="0 0 24 24"
|
|
stroke-width="1.5"
|
|
stroke="currentColor"
|
|
class="size-6"
|
|
>
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="m8.25 4.5 7.5 7.5-7.5 7.5" />
|
|
</svg>
|
|
}
|
|
}
|
|
|
|
#[component]
|
|
pub fn CodeBracketSquare() -> impl IntoView {
|
|
view! {
|
|
<svg
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
fill="none"
|
|
viewBox="0 0 24 24"
|
|
stroke-width="1.5"
|
|
stroke="currentColor"
|
|
class="size-6"
|
|
>
|
|
<path
|
|
stroke-linecap="round"
|
|
stroke-linejoin="round"
|
|
d="M14.25 9.75 16.5 12l-2.25 2.25m-4.5 0L7.5 12l2.25-2.25M6 20.25h12A2.25 2.25 0 0 0 20.25 18V6A2.25 2.25 0 0 0 18 3.75H6A2.25 2.25 0 0 0 3.75 6v12A2.25 2.25 0 0 0 6 20.25Z"
|
|
/>
|
|
</svg>
|
|
}
|
|
}
|