import { AspectBox } from '@teambit/harmony.ui.aspect-box';
import React, { useContext } from 'react';
import { useDataQuery } from '@teambit/ui-foundation.ui.hooks.use-data-query';
import { gql } from '@apollo/client';
import { EmptyBox } from '@teambit/design.ui.empty-box';
import { H1 } from '@teambit/documenter.ui.heading';
import { Separator } from '@teambit/documenter.ui.separator';
import styles from './aspect-page.module.scss';
import { ComponentContext } from '../context';
const GET_COMPONENT = gql`
query ($id: String!) {
getHost {
get(id: $id) {
aspects {
id
config
data
icon
}
}
}
}
`;
// TODO: get the docs domain from the community aspect and pass it here as a prop
export function AspectPage() {
const component = useContext(ComponentContext);
const { data } = useDataQuery(GET_COMPONENT, {
variables: { id: component.id.toString() },
});
const aspectList = data?.getHost?.get?.aspects;
if (aspectList && aspectList.length === 0) {
return (