hezarfen_frontend
Clone
https://git.tahinli.com/archive/hezarfen_frontend.git
0 watching0 forksTypeScript5.5 MiB5fcd955Burak Boduroğlu2 months ago730 commits
| 1 | import type { Component } from "solid-js"; |
| 2 | import { Show } from "solid-js"; |
| 3 | |
| 4 | export type StatTileProps = { |
| 5 | label: string; |
| 6 | value: string; |
| 7 | caption?: string; |
| 8 | Icon: Component<{ class?: string }>; |
| 9 | }; |
| 10 | |
| 11 | /** Figma "Web / Stat Tile": subtle label + icon on top, a large value, an |
| 12 | * optional plain-text caption below. No delta arrow is drawn here — this |
| 13 | * project has no historical baseline to diff against, and a fabricated trend |
| 14 | * is worse than none. */ |
| 15 | export function StatTile(props: StatTileProps) { |
| 16 | return ( |
| 17 | <div class="flex flex-col gap-1.5 rounded-xl border border-border-line bg-surface-base px-4 py-3.5 shadow-sm"> |
| 18 | <div class="flex items-center gap-2"> |
| 19 | <p class="min-w-0 flex-1 truncate text-[13px] font-medium text-text-subtle">{props.label}</p> |
| 20 | <props.Icon class="h-[13px] w-[13px] shrink-0 text-text-subtle" /> |
| 21 | </div> |
| 22 | <p class="tabular-nums text-[26px] font-semibold leading-8 tracking-[-0.02em] text-text-strong">{props.value}</p> |
| 23 | <Show when={props.caption}> |
| 24 | <p class="truncate text-[13px] text-text-subtle">{props.caption}</p> |
| 25 | </Show> |
| 26 | </div> |
| 27 | ); |
| 28 | } |