import errorCopyJson from '../styles/error-copy.json';

export const ERROR_COPY: Readonly<Record<string, string>> = errorCopyJson;

export function copyForCode(code: string | null | undefined): string {
  if (!code) return ERROR_COPY.unknown ?? 'Something went wrong.';
  return ERROR_COPY[code] ?? ERROR_COPY.unknown ?? 'Something went wrong.';
}
