'use client'; import { useState } from 'react'; import { cn } from '@djangocfg/ui-core/lib'; import { Eye, MonitorUp, RefreshCw } from 'lucide-react'; import { PageSnapshotPreview } from './PageSnapshotPreview'; import { usePageSnapshot } from './use-page-snapshot'; /** Props for `PageSnapshotChip`. */ export interface PageSnapshotChipProps { className?: string; } /** * A small status chip the user sees near the composer when page-context * sharing is on. Communicates three things: * - that the screen is currently shared ("Screen connected"), * - whether the captured context is stale vs the page they now see, * - a way to inspect exactly what is shared (opens the preview drawer). * * Renders nothing when the user has not opted in — no opt-in, no chip. */ export function PageSnapshotChip({ className }: PageSnapshotChipProps) { const { isLinked, isStale, refresh } = usePageSnapshot(); const [previewOpen, setPreviewOpen] = useState(false); // No chip at all until the user opts in. if (!isLinked) return null; return ( <>