refactor(miniapp): extract shell states and finance visuals

This commit is contained in:
2026-03-11 18:44:12 +04:00
parent b193f8ddce
commit ebd12eb46e
6 changed files with 119 additions and 51 deletions

View File

@@ -0,0 +1,20 @@
import { HeroBanner } from '../layout/hero-banner'
type Props = {
badge: string
title: string
body: string
reloadLabel: string
onReload: () => void
}
export function BlockedState(props: Props) {
return (
<HeroBanner
badges={[props.badge]}
title={props.title}
body={props.body}
action={{ label: props.reloadLabel, onClick: props.onReload }}
/>
)
}

View File

@@ -0,0 +1,11 @@
import { HeroBanner } from '../layout/hero-banner'
type Props = {
badge: string
title: string
body: string
}
export function LoadingState(props: Props) {
return <HeroBanner badges={[props.badge]} title={props.title} body={props.body} />
}

View File

@@ -0,0 +1,47 @@
import { Show } from 'solid-js'
import { Button } from '../ui'
type Props = {
badge: string
title: string
body: string
joinActionLabel: string
joiningLabel: string
joining: boolean
canJoin: boolean
botLinkLabel: string
botLink: string | null
reloadLabel: string
onJoin: () => void
onReload: () => void
}
export function OnboardingState(props: Props) {
return (
<section class="hero-card">
<div class="hero-card__meta">
<span class="pill">{props.badge}</span>
</div>
<h2>{props.title}</h2>
<p>{props.body}</p>
<div class="nav-grid">
<Show when={props.canJoin}>
<Button variant="ghost" disabled={props.joining} onClick={props.onJoin}>
{props.joining ? props.joiningLabel : props.joinActionLabel}
</Button>
</Show>
<Show when={props.botLink}>
{(link) => (
<a class="ui-button ui-button--ghost" href={link()} target="_blank" rel="noreferrer">
{props.botLinkLabel}
</a>
)}
</Show>
<Button variant="ghost" onClick={props.onReload}>
{props.reloadLabel}
</Button>
</div>
</section>
)
}