mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-09-07 08:26:15 +00:00
fix: resolve Biome formatting issues in background.ts and memories-grid.tsx
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
68678d91b0
commit
aec167cd90
2 changed files with 17 additions and 7 deletions
|
|
@ -31,10 +31,15 @@ const PLATFORM_LABELS: Record<string, string> = {
|
|||
|
||||
function normalizePlatform(value?: string): string | undefined {
|
||||
if (!value) return undefined
|
||||
return value.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "")
|
||||
return value
|
||||
.toLowerCase()
|
||||
.replace(/[^a-z0-9]+/g, "_")
|
||||
.replace(/^_+|_+$/g, "")
|
||||
}
|
||||
|
||||
function inferPlatformFromActionSource(actionSource: string): string | undefined {
|
||||
function inferPlatformFromActionSource(
|
||||
actionSource: string,
|
||||
): string | undefined {
|
||||
const source = actionSource.toLowerCase()
|
||||
if (source.includes("chatgpt")) return "chatgpt"
|
||||
if (source.includes("claude")) return "claude"
|
||||
|
|
@ -146,9 +151,10 @@ export default defineBackground(() => {
|
|||
content = data?.url || ""
|
||||
}
|
||||
|
||||
const platform = normalizePlatform(data.sourcePlatform)
|
||||
|| inferPlatformFromUrl(data.url)
|
||||
|| inferPlatformFromActionSource(actionSource)
|
||||
const platform =
|
||||
normalizePlatform(data.sourcePlatform) ||
|
||||
inferPlatformFromUrl(data.url) ||
|
||||
inferPlatformFromActionSource(actionSource)
|
||||
const platformLabel = platform
|
||||
? data.sourcePlatformLabel || PLATFORM_LABELS[platform] || platform
|
||||
: undefined
|
||||
|
|
|
|||
|
|
@ -109,7 +109,9 @@ const EXTENSION_PLATFORM_LABELS: Record<string, string> = {
|
|||
twitter: "X / Twitter",
|
||||
}
|
||||
|
||||
function getExtensionSourceLabel(document: DocumentWithMemories): string | null {
|
||||
function getExtensionSourceLabel(
|
||||
document: DocumentWithMemories,
|
||||
): string | null {
|
||||
const metadata = document.metadata
|
||||
if (!metadata || typeof metadata !== "object") return null
|
||||
|
||||
|
|
@ -1263,7 +1265,9 @@ const DocumentCard = memo(
|
|||
day: "numeric",
|
||||
year: "numeric",
|
||||
})
|
||||
return [sourceLabel, badge, date].filter(Boolean).join(" - ")
|
||||
return [sourceLabel, badge, date]
|
||||
.filter(Boolean)
|
||||
.join(" - ")
|
||||
})()}
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue