import React from 'react'; import {useNode} from '@jahia/nextjs-sdk'; import {MenuBtnIsotopePropsType} from '../types'; import classnames from 'classnames'; export const MenuBtn = ({id, handleClick, activeClass, styles}:MenuBtnIsotopePropsType) => { const {data, loading, error} = useNode(id, ['jcr:title']); if (loading) { return
loading
; } if (error) { console.error(error); return
Error when loading ${JSON.stringify(error)}
; } if (!data || !data.properties) { return
No data returned by IsotopeContentRetrieval
; } const {name, properties} = data; let label = name; if (properties && properties['jcr:title']) { label = properties['jcr:title'] as string; } return ( ); };