import { co, CoList, CoMap } from "jazz-tools"

// GlobalTopic is topic that is accessible from `learn-anything.xyz/name`
export class GlobalTopic extends CoMap {
	name = co.string // name of topic, used for url `learn-anything.xyz/name` (unique)
	prettyName = co.string // pretty name of topic, e.g. "React"
	aiSummary = co.optional.ref(GlobalTopicAiSummary) // high quality summary of topic (generated by AI)
	humanSummary = co.optional.string // human created summary of link (simplified, cleaner)
	topicAiSummary = co.optional.string // summary of topic (generated by AI)
	topicSummary = co.optional.string // summary of topic (generated by AI)
	public = co.optional.boolean // if true, topic is accessible from global search
}

// GlobalTopicAiSummary is high quality summary of topic (generated by AI)
export class GlobalTopicAiSummary extends CoMap {
	topic = co.ref(GlobalTopic) // topic the summary is for
	aiModelUsed = co.string // model used to generate summary, e.g. "gpt-4o"
	summary = co.string // high quality summary of topic (generated by AI)
}

export class GlobalTopicLists extends CoList.Of(co.ref(GlobalTopic)) {}
