feat(alerts): 가격 알람 (localStorage + 60s 폴러 + 토스트)

- lib/alerts.ts: id/code/op(gte|lte)/target/triggered 저장소, watchlist/recent 와 동일 pub/sub
- AlertsPanel: 종목 사이드바에 ≥/≤ 토글 + 목표가 입력 + 활성 알람 리스트(재무장/삭제)
- AlertsToaster: layout 전역 마운트, 미발사 알람 코드만 폴링, 조건 충족시 markTriggered + 우측 하단 토스트(6s), Notification 권한 허용 시 브라우저 알림 병행
This commit is contained in:
claude-owner
2026-05-28 15:26:10 +09:00
parent 01e5eba3c1
commit fd7026ad09
5 changed files with 397 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
import "./globals.css";
import type { Metadata } from "next";
import { AlertsToaster } from "../components/AlertsToaster";
import { TopNav } from "../components/TopNav";
export const metadata: Metadata = {
@@ -13,6 +14,7 @@ export default function RootLayout({ children }: { children: React.ReactNode })
<body className="min-h-screen">
<TopNav />
{children}
<AlertsToaster />
</body>
</html>
);