SurfSense/surfsense_browser_extension/sidepanel/chat/QuickCapture.tsx
API Test Bot a052b01a68 docs: update PRD with comprehensive extension features and UX integration strategy
- Added UX strategy: Extension for Quick Actions, Frontend for Management
- Organized features into 4 phases (Phase 1 completed)
- Added 14 new extension features (FR-EXT-07 to FR-EXT-17):
  * Smart Monitoring: Price alerts, whale tracking, rug pull detection
  * Trading Intelligence: Token analysis, entry/exit suggestions, portfolio tracker
  * Content Creation: Chart screenshots, AI thread generator
  * Productivity: Quick actions, notifications, keyboard shortcuts
- Added Feature Responsibility Matrix showing Extension vs Frontend roles
- Added Settings Sync strategy (FR-EXT-06) with deep links to frontend
- Documented state sync architecture: Extension ↔ Backend API ↔ Frontend
2026-02-01 21:32:06 +07:00

49 lines
1.4 KiB
TypeScript

import { Camera } from "lucide-react";
import { Button } from "@/routes/ui/button";
import { useToast } from "@/routes/ui/use-toast";
/**
* Quick capture button (sticky at bottom)
* Reuses existing capture functionality
*/
export function QuickCapture() {
const { toast } = useToast();
const handleCapture = async () => {
try {
// Get active tab
const [tab] = await chrome.tabs.query({ active: true, currentWindow: true });
if (!tab.id) {
throw new Error("No active tab");
}
// Send message to background to capture page
chrome.runtime.sendMessage({
type: "CAPTURE_PAGE",
tabId: tab.id,
});
toast({
title: "Page captured!",
description: "Saved to your search space",
});
} catch (error) {
console.error("Failed to capture page:", error);
toast({
title: "Capture failed",
description: "Please try again",
variant: "destructive",
});
}
};
return (
<div className="sticky bottom-0 border-t p-3 bg-background">
<Button className="w-full" onClick={handleCapture}>
<Camera className="mr-2 h-4 w-4" />
Save Current Page
</Button>
</div>
);
}