mirror of
https://github.com/Open-Dev-Society/OpenStock.git
synced 2026-10-02 04:54:32 +08:00
Floated shell with a dark sidebar and browser-style tabs, hatch shells, bento tiles, warm OKLCH palette with OpenStock teal, Plus Jakarta Sans + IBM Plex Mono. Rebuilt stock page (native header, streaming), watchlist (real table, alerts pane, news rows), auth pages (live product preview, choice chips), search palette, alert modal and donate popup. Removes Header/Footer/NavItems/UserDropdown/SirayBanner and the unused watchlist widgets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
17 lines
617 B
TypeScript
17 lines
617 B
TypeScript
import { ArrowDownRight, ArrowUpRight } from "lucide-react";
|
|
|
|
// Direction is carried by colour and arrow, so it never relies on colour alone.
|
|
const ChangePill = ({ value }: { value?: number | null }) => {
|
|
if (value == null || !Number.isFinite(value)) return <span className="pill">—</span>;
|
|
if (value === 0) return <span className="pill">0.00%</span>;
|
|
const up = value > 0;
|
|
return (
|
|
<span className={up ? 'pill is-up' : 'pill is-down'}>
|
|
{up ? <ArrowUpRight /> : <ArrowDownRight />}
|
|
{Math.abs(value).toFixed(2)}%
|
|
</span>
|
|
);
|
|
};
|
|
|
|
export default ChangePill;
|