115 lines
5.1 KiB
TypeScript
115 lines
5.1 KiB
TypeScript
import { Activity, Eye, Lightbulb, Loader2, MessageSquare, Radar } from "lucide-react";
|
||
import { Badge } from "@/components/ui/badge";
|
||
import { Button } from "@/components/ui/button";
|
||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||
import { TabsContent } from "@/components/ui/tabs";
|
||
|
||
interface SignalsTabProps {
|
||
featureLoading: string | null;
|
||
onStartHNMonitor: () => void;
|
||
onOpenFeishuConfig: () => void;
|
||
}
|
||
|
||
export default function SignalsTab({ featureLoading, onStartHNMonitor, onOpenFeishuConfig }: SignalsTabProps) {
|
||
return (
|
||
<TabsContent value="signals" className="mt-6">
|
||
<div className="space-y-6">
|
||
<div className="flex items-center justify-between">
|
||
<div>
|
||
<h3 className="text-xl font-semibold flex items-center gap-2">
|
||
<Radar className="w-5 h-5 text-blue-500" />
|
||
信号捕获状态
|
||
</h3>
|
||
<p className="text-sm text-slate-600 dark:text-slate-400">AI 自动从多个来源捕获需求信号</p>
|
||
</div>
|
||
<Button onClick={onStartHNMonitor} disabled={featureLoading === "hn-monitor"}>
|
||
{featureLoading === "hn-monitor" ? (
|
||
<>
|
||
<Loader2 className="w-4 h-4 mr-2 animate-spin" />
|
||
启动中…
|
||
</>
|
||
) : (
|
||
<>
|
||
<Activity className="w-4 h-4 mr-2" />
|
||
启动 HN 监控
|
||
</>
|
||
)}
|
||
</Button>
|
||
</div>
|
||
|
||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||
<Card className="border-blue-200 dark:border-blue-800">
|
||
<CardHeader>
|
||
<div className="flex items-center gap-2">
|
||
<MessageSquare className="w-5 h-5 text-blue-500" />
|
||
<CardTitle className="text-lg">飞书群聊</CardTitle>
|
||
<Badge className="ml-auto" variant="default">运行中</Badge>
|
||
</div>
|
||
</CardHeader>
|
||
<CardContent>
|
||
<p className="text-sm text-slate-600 dark:text-slate-400 mb-3">自动监听飞书群聊,识别有价值的需求讨论</p>
|
||
<div className="text-xs text-slate-500">
|
||
配置状态:<span className="text-green-600">已配置</span>
|
||
</div>
|
||
<Button variant="outline" size="sm" className="mt-3" onClick={onOpenFeishuConfig}>
|
||
查看配置
|
||
</Button>
|
||
</CardContent>
|
||
</Card>
|
||
|
||
<Card className="border-purple-200 dark:border-purple-800">
|
||
<CardHeader>
|
||
<div className="flex items-center gap-2">
|
||
<Activity className="w-5 h-5 text-purple-500" />
|
||
<CardTitle className="text-lg">技术资讯(HN)</CardTitle>
|
||
<Badge className="ml-auto" variant="secondary">可启用</Badge>
|
||
</div>
|
||
</CardHeader>
|
||
<CardContent>
|
||
<p className="text-sm text-slate-600 dark:text-slate-400 mb-3">定时抓取 HN 首页,分析技术趋势</p>
|
||
<div className="text-xs text-slate-500">监控间隔:30 分钟</div>
|
||
<Button onClick={onStartHNMonitor} variant="outline" size="sm" className="mt-3" disabled={featureLoading === "hn-monitor"}>
|
||
{featureLoading === "hn-monitor" ? "启动中…" : "启动监控"}
|
||
</Button>
|
||
</CardContent>
|
||
</Card>
|
||
|
||
<Card className="border-slate-200 dark:border-slate-800 opacity-60">
|
||
<CardHeader>
|
||
<div className="flex items-center gap-2">
|
||
<Eye className="w-5 h-5 text-slate-500" />
|
||
<CardTitle className="text-lg">浏览器标签</CardTitle>
|
||
<Badge className="ml-auto" variant="outline">需扩展</Badge>
|
||
</div>
|
||
</CardHeader>
|
||
<CardContent>
|
||
<p className="text-sm text-slate-600 dark:text-slate-400 mb-3">监控访问的技术文档、竞品页面</p>
|
||
<div className="text-xs text-slate-500">需要安装浏览器扩展</div>
|
||
<Button variant="outline" size="sm" className="mt-3" disabled>
|
||
敬请期待
|
||
</Button>
|
||
</CardContent>
|
||
</Card>
|
||
|
||
<Card className="border-slate-200 dark:border-slate-800 opacity-60">
|
||
<CardHeader>
|
||
<div className="flex items-center gap-2">
|
||
<Lightbulb className="w-5 h-5 text-slate-500" />
|
||
<CardTitle className="text-lg">代码仓</CardTitle>
|
||
<Badge className="ml-auto" variant="outline">需配置</Badge>
|
||
</div>
|
||
</CardHeader>
|
||
<CardContent>
|
||
<p className="text-sm text-slate-600 dark:text-slate-400 mb-3">监控竞品仓库更新、上游依赖变更</p>
|
||
<div className="text-xs text-slate-500">需要配置回调地址</div>
|
||
<Button variant="outline" size="sm" className="mt-3" disabled>
|
||
敬请期待
|
||
</Button>
|
||
</CardContent>
|
||
</Card>
|
||
</div>
|
||
</div>
|
||
</TabsContent>
|
||
);
|
||
}
|