mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-09-10 22:41:17 +00:00
remove unused imports
This commit is contained in:
parent
89777ce8b0
commit
bc97cb6862
1 changed files with 0 additions and 194 deletions
|
|
@ -9,9 +9,7 @@ import { useQuery } from "@tanstack/react-query"
|
|||
import { useRouter } from "next/navigation"
|
||||
import Image from "next/image"
|
||||
import {
|
||||
Activity,
|
||||
ArrowRight,
|
||||
Clock,
|
||||
ExternalLink,
|
||||
FileText,
|
||||
Lightbulb,
|
||||
|
|
@ -651,198 +649,6 @@ function formatToolUsageTime(date: Date | null, hasBeenUsed: boolean): string {
|
|||
return date.toLocaleDateString()
|
||||
}
|
||||
|
||||
// Format absolute time for tooltip display
|
||||
function formatAbsoluteTime(date: Date | null): string {
|
||||
if (!date) return ""
|
||||
return date.toLocaleString(undefined, {
|
||||
month: "short",
|
||||
day: "numeric",
|
||||
hour: "numeric",
|
||||
minute: "2-digit",
|
||||
hour12: true,
|
||||
})
|
||||
}
|
||||
|
||||
// Check if item was active recently (within last hour)
|
||||
function isRecentlyActive(date: Date | null): boolean {
|
||||
if (!date) return false
|
||||
return Date.now() - date.getTime() < 60 * 60 * 1000
|
||||
}
|
||||
|
||||
function _RecentToolUsageCard({
|
||||
items,
|
||||
onOpenPlugins,
|
||||
onNavigateToMemories,
|
||||
onOpenToolDocument,
|
||||
}: {
|
||||
items: ToolUsageItem[]
|
||||
onOpenPlugins: () => void
|
||||
onNavigateToMemories: () => void
|
||||
onOpenToolDocument: (document: DocumentWithMemories) => void
|
||||
}) {
|
||||
// Show at most 3 items
|
||||
const displayItems = items.slice(0, 3)
|
||||
|
||||
// Empty state - no tool activity
|
||||
if (displayItems.length === 0) {
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
"bg-surface-card/60 backdrop-blur-md rounded-xl px-3 py-4 flex flex-col items-center justify-center gap-2.5 shadow-[0_12px_40px_rgba(0,0,0,0.22)] h-full min-h-[120px]",
|
||||
dmSansClassName(),
|
||||
)}
|
||||
>
|
||||
<Plug className="size-5 text-fg-faint" />
|
||||
<p className="text-[11px] text-fg-subtle text-center">
|
||||
No recent tool activity
|
||||
</p>
|
||||
<button
|
||||
type="button"
|
||||
onClick={onOpenPlugins}
|
||||
className="text-[11px] font-medium text-[#5EA8FF] hover:text-[#8BC6FF] transition-colors cursor-pointer"
|
||||
>
|
||||
Set up integrations →
|
||||
</button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
"bg-surface-card/60 backdrop-blur-md rounded-xl px-2.5 py-2 flex flex-col gap-0 shadow-[0_12px_40px_rgba(0,0,0,0.22)]",
|
||||
dmSansClassName(),
|
||||
)}
|
||||
>
|
||||
<ul className="flex flex-col gap-0.5">
|
||||
{displayItems.map((item, index) => {
|
||||
const recentlyActive = isRecentlyActive(item.lastUsedAt)
|
||||
|
||||
return (
|
||||
<motion.li
|
||||
key={item.id}
|
||||
initial={{ opacity: 0, y: 6 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
transition={{
|
||||
duration: 0.25,
|
||||
delay: index * 0.06,
|
||||
ease: [0.4, 0, 0.2, 1],
|
||||
}}
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
if (item.lastDocument) {
|
||||
onOpenToolDocument(item.lastDocument)
|
||||
return
|
||||
}
|
||||
onNavigateToMemories()
|
||||
}}
|
||||
className="group w-full flex items-start gap-2.5 rounded-lg border border-transparent px-2.5 py-2.5 hover:border-[#22314A] hover:bg-surface-hover/80 transition-all cursor-pointer"
|
||||
>
|
||||
{/* Icon with status indicator */}
|
||||
<div className="relative flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-surface-card ring-1 ring-surface-border group-hover:ring-[#3A4A63] transition-colors">
|
||||
{item.icon ? (
|
||||
<Image
|
||||
src={item.icon}
|
||||
alt={item.name}
|
||||
width={18}
|
||||
height={18}
|
||||
className="size-[18px]"
|
||||
/>
|
||||
) : item.type === "MCP" ? (
|
||||
<MCPIcon className="size-[18px]" />
|
||||
) : (
|
||||
<Plug className="size-[18px] text-fg-subtle" />
|
||||
)}
|
||||
{/* Activity status dot */}
|
||||
<span
|
||||
className={cn(
|
||||
"absolute -top-0.5 -right-0.5 size-2 rounded-full ring-2 ring-[#0D1117]",
|
||||
item.hasBeenUsed
|
||||
? recentlyActive
|
||||
? "bg-[#00C853]"
|
||||
: "bg-[#4BA0FA]"
|
||||
: "bg-[#3A4455]",
|
||||
)}
|
||||
>
|
||||
{recentlyActive && (
|
||||
<span className="absolute inset-0 rounded-full bg-[#00C853] animate-ping opacity-60" />
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{/* Name and metadata */}
|
||||
<div className="flex-1 min-w-0 text-left">
|
||||
<div className="flex items-center gap-1.5">
|
||||
<p className="text-[12px] font-medium text-fg-secondary group-hover:text-white transition-colors leading-tight truncate">
|
||||
{item.name}
|
||||
</p>
|
||||
<span
|
||||
className={cn(
|
||||
"shrink-0 inline-flex items-center rounded-full px-1.5 py-px text-[8px] font-semibold uppercase tracking-wider",
|
||||
item.type === "MCP"
|
||||
? "bg-[#D4A853]/10 text-[#D4A853]/80"
|
||||
: "bg-[#4BA0FA]/10 text-[#4BA0FA]/80",
|
||||
)}
|
||||
>
|
||||
{item.type}
|
||||
</span>
|
||||
</div>
|
||||
<p className="mt-1 text-[10px] text-fg-muted leading-snug line-clamp-2">
|
||||
{item.lastDocumentPreview ??
|
||||
item.lastDocumentTitle ??
|
||||
"Open the latest saved context from this tool."}
|
||||
</p>
|
||||
<div className="flex items-center gap-1.5 mt-1 flex-wrap">
|
||||
{/* Last used */}
|
||||
<span className="inline-flex items-center gap-0.5">
|
||||
<Activity className="size-2.5 text-fg-faint shrink-0" />
|
||||
<span
|
||||
className={cn(
|
||||
"text-[9px]",
|
||||
item.hasBeenUsed
|
||||
? recentlyActive
|
||||
? "text-[#00C853]/80"
|
||||
: "text-fg-muted"
|
||||
: "text-fg-faint",
|
||||
)}
|
||||
>
|
||||
{item.hasBeenUsed && item.lastUsedAt
|
||||
? `${formatToolUsageTime(item.lastUsedAt, true)} · ${formatAbsoluteTime(item.lastUsedAt)}`
|
||||
: formatToolUsageTime(
|
||||
item.lastUsedAt,
|
||||
item.hasBeenUsed,
|
||||
)}
|
||||
</span>
|
||||
</span>
|
||||
{/* Connected since */}
|
||||
{item.connectedAt && (
|
||||
<>
|
||||
<span className="text-[#2A3040]">·</span>
|
||||
<span className="inline-flex items-center gap-0.5">
|
||||
<Clock className="size-2.5 text-fg-faint shrink-0" />
|
||||
<span className="text-[9px] text-fg-faint">
|
||||
Since{" "}
|
||||
{item.connectedAt.toLocaleDateString(undefined, {
|
||||
month: "short",
|
||||
day: "numeric",
|
||||
})}
|
||||
</span>
|
||||
</span>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</button>
|
||||
</motion.li>
|
||||
)
|
||||
})}
|
||||
</ul>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
function ToolUsageRecentRow({
|
||||
item,
|
||||
onOpenPlugins,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue