import seed from "../data/personas.json";

export type DesignPersonaId = "alice" | "bob" | "carol" | "danny";

export const DEFAULT_DESIGN_PERSONA: DesignPersonaId = "alice";

export const DESIGN_PERSONAS = seed.personas.map((persona) => ({
  id: persona.id as DesignPersonaId,
  label: persona.designName,
  codeName: persona.publicCodeName,
  sourceGuid: persona.sourceGuid,
  initials: persona.initials,
})) as readonly {
  id: DesignPersonaId;
  label: string;
  codeName: string;
  sourceGuid: string;
  initials: string;
}[];

export function isDesignPersonaId(value: string | null): value is DesignPersonaId {
  return DESIGN_PERSONAS.some((persona) => persona.id === value);
}
