[package]
name = "chattyness-user-ui"
version.workspace = true
edition.workspace = true

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
chattyness-db = { workspace = true }
chattyness-error = { workspace = true, optional = true }
chattyness-shared = { workspace = true, optional = true }
serde.workspace = true
serde_json.workspace = true
uuid.workspace = true
chrono.workspace = true
tracing = { workspace = true, optional = true }

# Leptos
leptos = { workspace = true }
leptos_meta = { workspace = true }
leptos_router = { workspace = true }

# SSR-only dependencies
axum = { workspace = true, optional = true }
sqlx = { workspace = true, optional = true }
tower = { workspace = true, optional = true }
tower-sessions = { workspace = true, optional = true }
tower-sessions-sqlx-store = { workspace = true, optional = true }
tokio = { workspace = true, optional = true }
sha2 = { workspace = true, optional = true }
hex = { workspace = true, optional = true }
rand = { workspace = true, optional = true }
reqwest = { workspace = true, optional = true }
image = { workspace = true, optional = true }
futures = { workspace = true, optional = true }
dashmap = { workspace = true, optional = true }

# Hydrate-only dependencies
gloo-net = { workspace = true, optional = true }
gloo-timers = { workspace = true, optional = true }
web-sys = { workspace = true, optional = true }
wasm-bindgen = { workspace = true, optional = true }
console_error_panic_hook = { workspace = true, optional = true }
js-sys = { workspace = true, optional = true }

[features]
default = []
ssr = [
    "leptos/ssr",
    "leptos_meta/ssr",
    "leptos_router/ssr",
    "chattyness-db/ssr",
    "chattyness-error/ssr",
    "chattyness-shared/ssr",
    "dep:chattyness-error",
    "dep:chattyness-shared",
    "dep:axum",
    "dep:sqlx",
    "dep:tower",
    "dep:tower-sessions",
    "dep:tower-sessions-sqlx-store",
    "dep:tracing",
    "dep:tokio",
    "dep:sha2",
    "dep:hex",
    "dep:rand",
    "dep:reqwest",
    "dep:image",
    "dep:futures",
    "dep:dashmap",
]
hydrate = [
    "leptos/hydrate",
    "dep:gloo-net",
    "dep:gloo-timers",
    "dep:web-sys",
    "dep:wasm-bindgen",
    "dep:console_error_panic_hook",
    "dep:js-sys",
]
