haixunMaster/lib/types/topic-goal.ts

14 lines
415 B
TypeScript

export type TopicGoal = "viral" | "placement";
export const TOPIC_GOAL_LABELS: Record<TopicGoal, string> = {
viral: "爆款模仿",
placement: "置入產品",
};
export function parseTopicGoal(value: string | null | undefined): TopicGoal {
return value === "placement" ? "placement" : "viral";
}
export function isPlacementGoal(value: string | null | undefined): boolean {
return value === "placement";
}