useProject
This hook provides the project (tenant) data.
function Page() {
const project = useProject()
return (
<div>
Env: {project.api.includes('localhost') ? 'Localhost' : 'Production'}
Fetched at: {project.data.fetchedAt}
</div>
)
}
export interface ProjectState {
/** Unique project identifier */
pid: string
/** Origin of the API server
* @example https://eu.healthblocks.io
*/
api: string
/** App key: app/dashboard */
app: string
/** GraphQL endpoint
* @example https://eu.healthblocks.io/v1/graphql
*/
graph?: string
/** Project data */
data: PublicProject | null
/** Project error state */
error: Error | null
/** Project loading state */
loading: boolean
/** Refresh the project data */
refetch: (options?: FetchProjectOptions) => void
}