import Dexie from "dexie";
import locale from "iso-639-1";
export const db = new Dexie("translations");

const languages = locale.getAllCodes();
db.version(2).stores({
  kwarg: "&key, value, screenId",
  ...languages.reduce(
    (x, y) => ({ ...x, [y]: "&key, value, screenId, updatedAt" }),
    {}
  ),
  words: "&text, screenId, updatedAt",
});
