;; Newsletter management components (defcomp ~account-newsletter-desc (&key description) (when description (p :class "text-xs text-stone-500 mt-0.5 truncate" (raw! description)))) (defcomp ~account-newsletter-toggle (&key id url hdrs target cls checked knob-cls) (div :id id :class "flex items-center" (button :hx-post url :hx-headers hdrs :hx-target target :hx-swap "outerHTML" :class cls :role "switch" :aria-checked checked (span :class knob-cls)))) (defcomp ~account-newsletter-toggle-off (&key id url hdrs target) (div :id id :class "flex items-center" (button :hx-post url :hx-headers hdrs :hx-target target :hx-swap "outerHTML" :class "relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2 bg-stone-300" :role "switch" :aria-checked "false" (span :class "inline-block h-4 w-4 rounded-full bg-white shadow transform transition-transform translate-x-1")))) (defcomp ~account-newsletter-item (&key name desc-html toggle-html) (div :class "flex items-center justify-between py-4 first:pt-0 last:pb-0" (div :class "min-w-0 flex-1" (p :class "text-sm font-medium text-stone-800" (raw! name)) (raw! desc-html)) (div :class "ml-4 flex-shrink-0" (raw! toggle-html)))) (defcomp ~account-newsletter-list (&key items-html) (div :class "divide-y divide-stone-100" (raw! items-html))) (defcomp ~account-newsletter-empty () (p :class "text-sm text-stone-500" "No newsletters available.")) (defcomp ~account-newsletters-panel (&key list-html) (div :class "w-full max-w-3xl mx-auto px-4 py-6" (div :class "bg-white/70 backdrop-blur rounded-2xl shadow border border-stone-200 p-6 sm:p-8 space-y-6" (h1 :class "text-xl font-semibold tracking-tight" "Newsletters") (raw! list-html))))