import type { ComponentType } from 'react';
import React, { useContext } from 'react';
import type { ScopeID } from '@teambit/scopes.scope-id';
import { ComponentGrid } from '@teambit/explorer.ui.gallery.component-grid';
import { ScopeDetails } from '@teambit/scope.ui.scope-details';
import { PreviewPlaceholder } from '@teambit/preview.ui.preview-placeholder';
import { EmptyScope } from '@teambit/scope.ui.empty-scope';
import { Tooltip } from '@teambit/design.ui.tooltip';
import { ComponentID } from '@teambit/component-id';
import { ComponentCard, type ComponentCardPluginType, type PluginProps } from '@teambit/explorer.ui.component-card';
import type { ComponentModel } from '@teambit/component';
import { ScopeContext } from '@teambit/scope.ui.hooks.scope-context';
import type { ComponentDescriptor } from '@teambit/component-descriptor';
import styles from './scope-overview.module.scss';
import type { ScopeBadgeSlot, OverviewLineSlot } from '../../scope.ui.runtime';
export type ScopeOverviewProps = {
badgeSlot: ScopeBadgeSlot;
overviewSlot: OverviewLineSlot;
TargetOverview?: ComponentType;
};
export class LinkPlugin {
link(id) {
return id.fullName;
}
}
export function ScopeOverview({ badgeSlot, overviewSlot, TargetOverview }: ScopeOverviewProps) {
const scope = useContext(ScopeContext);
const { components, componentDescriptors } = scope;
if (TargetOverview) return