Closes #8737 - Refactored actions by creating hooks to add the possibility to register actions programatically. - Small fixes from #8610 review - Fixed shortcuts display inside the command menu - Removed `actionMenuEntriesComponentState` and introduced `actionMenuEntriesComponentSelector`
18 lines
680 B
TypeScript
18 lines
680 B
TypeScript
import { contextStoreCurrentObjectMetadataIdComponentState } from '@/context-store/states/contextStoreCurrentObjectMetadataIdComponentState';
|
|
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
|
|
|
|
export const useContextStoreCurrentObjectMetadataIdOrThrow = (
|
|
instanceId?: string,
|
|
) => {
|
|
const contextStoreCurrentObjectMetadataId = useRecoilComponentValueV2(
|
|
contextStoreCurrentObjectMetadataIdComponentState,
|
|
instanceId,
|
|
);
|
|
|
|
if (!contextStoreCurrentObjectMetadataId) {
|
|
throw new Error('contextStoreCurrentObjectMetadataIdComponent is not set');
|
|
}
|
|
|
|
return contextStoreCurrentObjectMetadataId;
|
|
};
|