Files
DeepTutor/web/features/notes/model/flashcards.ts
Matt Van Horn 7f061c5675 feat(notes): export flashcards for Anki
Add a tab-separated Anki import from a note page and from the review
queue so learners can File -> Import cards into a deck named after the
note. Re-importing uses stable card GUIDs and does not include review
scheduling.
2026-10-27 22:07:06 +00:00

11 lines
410 B
TypeScript

import type { NoteBlock } from '@/lib/notes-api'
/** True when the page contains at least one Flash Cards learning block. */
export function pageHasFlashcards(blocks: NoteBlock[] | null | undefined): boolean {
for (const block of blocks ?? []) {
if (block.type === 'learning' && block.props?.kind === 'flashcards') return true
if (pageHasFlashcards(block.children)) return true
}
return false
}