Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

414 B
Raw Blame
import type { Content } from '@/data/content/content-query'

export type SnippetSelectionAction = 'already-added' | 'confirm-share' | 'add'

export function resolveSnippetSelection(
  snippet: { visibility: Content['visibility'] },
  isAlreadyInReport: boolean
): SnippetSelectionAction {
  if (isAlreadyInReport) return 'already-added'
  if (snippet.visibility === 'user') return 'confirm-share'
  return 'add'
}