Rename useAccountWorkspace to useTeamAccountWorkspace

The function useAccountWorkspace has been renamed to useTeamAccountWorkspace to better reflect its usage and context. The corresponding references and related error message were also updated to ensure consistency.
This commit is contained in:
gbuomprisco
2024-07-05 12:50:41 +08:00
parent 49fa8e966c
commit bda79d41c0

View File

@@ -5,16 +5,16 @@ import { useContext } from 'react';
import { TeamAccountWorkspaceContext } from '../components';
/**
* @name useAccountWorkspace
* @name useTeamAccountWorkspace
* @description A hook to access the account workspace data.
* @returns The account workspace data.
*/
export function useAccountWorkspace() {
export function useTeamAccountWorkspace() {
const ctx = useContext(TeamAccountWorkspaceContext);
if (!ctx) {
throw new Error(
'useAccountWorkspace must be used within a TeamAccountWorkspaceContext.Provider. This is only provided within the account workspace /home/[account]',
'useTeamAccountWorkspace must be used within a TeamAccountWorkspaceContext.Provider. This is only provided within the account workspace /home/[account]',
);
}