diff --git a/www/src/components/CodeEditorHelper/index.tsx b/www/src/components/CodeEditorHelper/index.tsx index cc55736c..7d0c67ca 100644 --- a/www/src/components/CodeEditorHelper/index.tsx +++ b/www/src/components/CodeEditorHelper/index.tsx @@ -26,44 +26,39 @@ function AvailableValueTag({ label, details }) { */ export default function CodeEditorHelper({ docLink }) { const { tableState } = useFiretableContext(); - + const availableVariables = [ + { + key: "row", + description: `row has the value of doc.data() it has type definitions using this table's schema, but you can access any field in the document.`, + }, + { + key: "db", + description: `db object provides access to firestore database instance of this project. giving you access to any collection or document in this firestore instance`, + }, + { + key: "ref", + description: `ref object that represents the reference to the current row in firestore db (ie: doc.ref).`, + }, + { + key: "auth", + description: `auth provides access to a firebase auth instance, can be used to manage auth users or generate tokens.`, + }, + { + key: "storage", + description: `firebase Storage can be accessed through this, storage.bucket() returns default storage bucket of the firebase project.`, + }, + { + key: "utilFns", + description: `utilFns provides a set of functions that are commonly used, such as easy access to GCP Secret Manager`, + }, + ]; return ( You have access to:{" "} - - You have acces to the object "row" at the top level. Typing "row" - in the code editor to get auto completion. Below are the fields of - row you can use in this table: -
-
- {Object.keys(tableState?.columns!).join(", ")} - - } - /> - - - - - + {availableVariables.map((v) => ( + + ))}