import React from 'react'; import { AttributeField, RecordClass, Question } from 'wdk-client/Utils/WdkModel'; import AttributeAnalysisButton from 'wdk-client/Views/AttributeAnalysis/AttributeAnalysisButton'; import { Plugin, PluginEntryContext } from 'wdk-client/Utils/ClientPlugin'; import { OpenAttributeAnalysis, CloseAttributeAnalysis } from 'wdk-client/Views/ResultTableSummaryView/Types'; import {ResultType} from 'wdk-client/Utils/WdkResult'; interface Props { activeAttributeAnalysisName: string | undefined; attribute: AttributeField; recordClass: RecordClass; question: Question; resultType: ResultType; headingComponents: { SortTrigger: React.ComponentType; HelpTrigger: React.ComponentType; ClickBoundary: React.ComponentType; }; removeAttribute: () => void; openAttributeAnalysis: OpenAttributeAnalysis; closeAttributeAnalysis: CloseAttributeAnalysis; } export default function AttributeHeading(props: Props) { const { activeAttributeAnalysisName, attribute, recordClass, question, resultType, headingComponents: { SortTrigger, HelpTrigger }, removeAttribute, openAttributeAnalysis, closeAttributeAnalysis, } = props; return (
{attribute.displayName} {attribute.isRemovable && (
)} {attribute.formats.map(reporter => { const context: PluginEntryContext = { type: 'attributeAnalysis', name: reporter.type, recordClassName: recordClass.urlSegment, searchName: question.urlSegment }; const pluginProps = { resultType, attributeName: attribute.name, reporterType: reporter.type }; return (
); })}
); }