forked from openedx/frontend-app-authoring
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComponentDetails.tsx
More file actions
42 lines (36 loc) · 1.14 KB
/
ComponentDetails.tsx
File metadata and controls
42 lines (36 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { FormattedMessage } from '@edx/frontend-platform/i18n';
import { Stack } from '@openedx/paragon';
import { useSidebarContext } from '../common/context/SidebarContext';
import { ComponentAdvancedInfo } from './ComponentAdvancedInfo';
import { ComponentUsage } from './ComponentUsage';
import messages from './messages';
import { HistoryComponentLog } from '../generic/history-log/HistoryLog';
const ComponentDetails = () => {
const { sidebarItemInfo } = useSidebarContext();
const usageKey = sidebarItemInfo?.id;
// istanbul ignore if: this should never happen
if (!usageKey) {
throw new Error('usageKey is required');
}
return (
<Stack gap={3}>
<>
<h3 className="h5">
<FormattedMessage {...messages.detailsTabUsageTitle} />
</h3>
<ComponentUsage usageKey={usageKey} />
</>
<hr className="w-100" />
<>
<h3 className="h5">
<FormattedMessage {...messages.detailsTabHistoryTitle} />
</h3>
<HistoryComponentLog
componentId={usageKey}
/>
</>
<ComponentAdvancedInfo />
</Stack>
);
};
export default ComponentDetails;