mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 01:19:31 +08:00
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.
11 lines
410 B
TypeScript
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
|
|
}
|