export type NotificationType = "follow" | "comment" | "reply" | "reaction" | "rating" | "mention";

export type NotificationLinkable = {
  type: NotificationType;
  recipeId: string | null;
  actorUsername: string | null;
};

/** Where clicking a notification should navigate to. Shared by the bell dropdown
 * and the full notifications page so the two never drift apart. */
export function notificationHref(n: NotificationLinkable): string {
  if (n.type === "follow") return n.actorUsername ? `/u/${n.actorUsername}` : "#";
  if (n.recipeId) return `/recipes/${n.recipeId}`;
  return "#";
}
