import { useAtom } from "jotai"; import { Stack, Typography, Grid, Tooltip, IconButton } from "@mui/material"; import SecretsIcon from "@mui/icons-material/VpnKeyOutlined"; import FunctionsIcon from "@mui/icons-material/CloudOutlined"; import DocsIcon from "@mui/icons-material/DescriptionOutlined"; import { projectScope, projectIdAtom } from "@src/atoms/projectScope"; export interface ICodeEditorHelperProps { docLink: string; additionalVariables?: { key: string; description: string; }[]; } export default function CodeEditorHelper({ docLink, additionalVariables, }: ICodeEditorHelperProps) { const [projectId] = useAtom(projectIdAtom, projectScope); const availableVariables = [ { 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: "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: "rowy", description: `rowy provides a set of functions that are commonly used, such as easy file uploads & access to GCP Secret Manager`, }, { key: "logging", description: `logging.log is encouraged to replace console.log`, }, ]; return ( Available: {availableVariables.concat(additionalVariables ?? []).map((v) => ( {v.key} ))} ); }