fix: warna verdict konsisten (hijau/merah), bar bukti biru-ungu netral
CI / go test + web typecheck (push) Canceled after 0s
CI / build + deploy (Nix) — flowsight (push) Canceled after 0s

This commit is contained in:
asepharyana
2026-09-15 21:04:51 +07:00
parent 793e0724ed
commit 7db077c2e6
2 changed files with 11 additions and 8 deletions
+10 -7
View File
@@ -16,28 +16,31 @@ export function Term(props: { kata: string }) {
); );
} }
// Verdict selalu hijau (Dilirik) / merah (Dilepas) / abu (Netral) —
// arti warna konsisten di seluruh app: hijau = kabar baik, merah = waspada.
export function VerdictBadge(props: { verdict: Verdict }) { export function VerdictBadge(props: { verdict: Verdict }) {
const warna: Record<Verdict, "default" | "error" | "secondary"> = { const warna: Record<Verdict, "success" | "error" | "secondary"> = {
"Dilirik": "default", "Dilirik": "success",
"Dilepas": "error", "Dilepas": "error",
"Netral": "secondary", "Netral": "secondary",
}; };
return <Badge variant={warna[props.verdict]}>{props.verdict}</Badge>; return <Badge variant={warna[props.verdict]}>{props.verdict}</Badge>;
} }
// Bar alasan: seberapa kuat sinyal asing vs broker (0-100). // Bar alasan: porsi bukti asing (biru, netral-informatif) vs broker (ungu).
// BUKAN hijau/merah — bar ini soal "bukti dari mana", bukan "baik/buruk".
export function AlasanBar(props: { asing: number; broker: number }) { export function AlasanBar(props: { asing: number; broker: number }) {
const total = Math.abs(props.asing) + Math.abs(props.broker) || 1; const total = Math.abs(props.asing) + Math.abs(props.broker) || 1;
const pAsing = Math.round((Math.abs(props.asing) / total) * 100); const pAsing = Math.round((Math.abs(props.asing) / total) * 100);
return ( return (
<div> <div>
<div class="flex h-2 w-full overflow-hidden rounded-full bg-muted"> <div class="flex h-2 w-full overflow-hidden rounded-full bg-muted">
<div class="bg-blue-500" style={{ width: `${pAsing}%` }} /> <div class="bg-sky-500" style={{ width: `${pAsing}%` }} />
<div class="bg-emerald-500" style={{ width: `${100 - pAsing}%` }} /> <div class="bg-violet-500" style={{ width: `${100 - pAsing}%` }} />
</div> </div>
<div class="mt-1 flex justify-between text-xs text-muted-foreground"> <div class="mt-1 flex justify-between text-xs text-muted-foreground">
<span><span class="text-blue-500">■</span> Asing {props.asing >= 0 ? "masuk" : "keluar"}</span> <span><span class="text-sky-500">■</span> Bukti asing {props.asing >= 0 ? "masuk" : "keluar"}</span>
<span><span class="text-emerald-500">■</span> Broker {props.broker >= 0 ? "borong" : "jualan"}</span> <span><span class="text-violet-500">■</span> Bukti broker {props.broker >= 0 ? "borong" : "jualan"}</span>
</div> </div>
</div> </div>
); );
+1 -1
View File
@@ -87,7 +87,7 @@ export default function Dashboard() {
const b = (s.row.breakdown || {}) as Record<string, unknown>; const b = (s.row.breakdown || {}) as Record<string, unknown>;
const cx = closeMap()[s.row.symbol]; const cx = closeMap()[s.row.symbol];
return ( return (
<Card class={s.verdict === "Dilirik" ? "border-l-4 border-l-emerald-500" : s.verdict === "Dilepas" ? "border-l-4 border-l-red-500" : ""}> <Card class={s.verdict === "Dilirik" ? "border-emerald-500/50" : s.verdict === "Dilepas" ? "border-red-500/50" : ""}>
<CardHeader class="flex flex-row items-center justify-between space-y-0 pb-2"> <CardHeader class="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle class="text-xl font-bold"> <CardTitle class="text-xl font-bold">
{s.row.symbol} {s.row.symbol}