export default async function addStep(db, { tags, name, beforeHtml, afterHtml }) {
  const id = db.getDocumentId();
  const Data = {
    id,
    tags,
    createdAt: new Date(),
    name,
    beforeHtml,
    afterHtml,
    // user: userId ? db.document("users", userId) : null,
    // createdAt: new Date() as any,
    // createdBy: state?.session?.uid
    //   ? db.document("users", state.session.uid)
    //   : null,
  };
  const addDoc = await db.add("steps", Data, id);
  Data.id = addDoc.id;
  return Data;
}
