Publish updated WeChat Radar

This commit is contained in:
joeseesun
2026-05-26 09:10:04 +08:00
parent 8abb29e13e
commit de7ec99fed
44 changed files with 2900 additions and 746 deletions
+9 -25
View File
@@ -1,9 +1,9 @@
'use client';
import { Calendar, RefreshCw, Database } from 'lucide-react';
import GlobalSearch from './GlobalSearch';
export type RangeKey = 'day' | 'week' | 'month' | 'quarter' | 'year' | 'custom';
export type RefreshMode = 'auto' | 'hour' | 'day' | 'week';
const RANGES: { key: RangeKey; label: string }[] = [
{ key: 'day', label: '日' },
@@ -11,14 +11,6 @@ const RANGES: { key: RangeKey; label: string }[] = [
{ key: 'month', label: '月' },
{ key: 'quarter', label: '季' },
{ key: 'year', label: '年' },
{ key: 'custom', label: '自定义' },
];
const MODES: { key: RefreshMode; label: string }[] = [
{ key: 'auto', label: '自动' },
{ key: 'hour', label: '时' },
{ key: 'day', label: '日' },
{ key: 'week', label: '周' },
];
export default function TopBar({
@@ -26,8 +18,6 @@ export default function TopBar({
date,
onRangeChange,
onDateChange,
mode,
onModeChange,
rescanning,
onRescan,
onFullSync,
@@ -37,36 +27,38 @@ export default function TopBar({
date: string;
onRangeChange: (r: RangeKey) => void;
onDateChange: (date: string) => void;
mode: RefreshMode;
onModeChange: (m: RefreshMode) => void;
rescanning: boolean;
onRescan: () => void;
onFullSync?: () => void;
rescanInfo?: string;
}) {
return (
<div className="flex items-center justify-between border-b border-[var(--border-soft)] bg-[rgba(8,13,10,0.74)] px-6 py-3 backdrop-blur">
<div className="flex items-center justify-between gap-4 border-b border-[var(--border-soft)] bg-[var(--chrome-bg)] px-6 py-3 backdrop-blur">
<div>
<div className="report-kicker">Daily Intelligence</div>
<div className="mt-1 text-[16px] font-semibold tracking-wide"> · </div>
<div className="mt-1 text-[16px] font-semibold tracking-wide"> · </div>
<div className="mt-0.5 text-[11px] text-[var(--text-3)]">
{rescanInfo ?? '尚未扫描,点击「重扫」加载数据'}
</div>
</div>
<div className="flex items-center gap-2">
<GlobalSearch />
<div className="control-surface flex items-center gap-1.5 rounded-md px-2.5 py-1.5">
<Calendar size={13} className="text-[var(--text-3)]" />
<input
type="date"
value={date}
onChange={(e) => onDateChange(e.target.value)}
className="bg-transparent text-[12px] outline-none [color-scheme:dark]"
title="按日期查看微信雷达"
className="theme-date-input min-w-[128px] bg-transparent text-[12px] outline-none"
title="按日期查看驾驶舱"
/>
</div>
<SegGroup>
<span className="border-r border-[var(--border-soft)] px-2 py-1 text-[11px] text-[var(--text-3)]">
</span>
{RANGES.map((r) => (
<SegBtn key={r.key} active={range === r.key} onClick={() => onRangeChange(r.key)}>
{r.label}
@@ -74,14 +66,6 @@ export default function TopBar({
))}
</SegGroup>
<SegGroup>
{MODES.map((m) => (
<SegBtn key={m.key} active={mode === m.key} onClick={() => onModeChange(m.key)}>
{m.label}
</SegBtn>
))}
</SegGroup>
{onFullSync && (
<button
className="btn"