forked from openedx/frontend-app-authoring
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfirmationView.tsx
More file actions
89 lines (83 loc) · 2.16 KB
/
ConfirmationView.tsx
File metadata and controls
89 lines (83 loc) · 2.16 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import { FormattedMessage } from '@edx/frontend-platform/i18n';
import {
Alert,
Card,
Container,
Icon,
Stack,
} from '@openedx/paragon';
import {
AccessTime,
Folder,
SubdirectoryArrowRight,
} from '@openedx/paragon/icons';
import type { ContentLibrary } from '@src/library-authoring/data/api';
import { LibraryV1Data } from '@src/studio-home/data/api';
import { BoldText } from '@src/utils';
import messages from './messages';
interface ConfirmationCardProps {
legacyLib: LibraryV1Data;
destinationName: string;
}
const ConfirmationCard = ({
legacyLib,
destinationName,
}: ConfirmationCardProps) => (
<Card className="mb-3.5">
<Card.Header
title={(
<Stack className="h4" direction="horizontal">
<Icon className="mr-1" src={Folder} />
<span>{legacyLib.displayName}</span>
</Stack>
)}
subtitle={(
<Stack className="mb-1.5" direction="horizontal">
<Icon className="mr-1.5" src={SubdirectoryArrowRight} />
<span>{destinationName}</span>
</Stack>
)}
/>
{legacyLib.isMigrated && (
<Stack className="ml-3.5 mt-1 mb-2 text-gray-500" direction="horizontal">
<Icon className="mr-1.5" src={AccessTime} />
<span className="x-small">
<FormattedMessage
{...messages.previouslyMigratedAlert}
values={{
libraryName: legacyLib.migratedToTitle,
b: BoldText,
}}
/>
</span>
</Stack>
)}
</Card>
);
interface ConfirmationViewProps {
destination: ContentLibrary;
legacyLibraries: LibraryV1Data[];
}
export const ConfirmationView = ({
destination,
legacyLibraries,
}: ConfirmationViewProps) => (
<Container className="confirmation-view">
<Alert variant="info">
<FormattedMessage
{...messages.confirmationViewAlert}
values={{
count: legacyLibraries.length,
b: BoldText,
}}
/>
</Alert>
{legacyLibraries.map((legacyLib) => (
<ConfirmationCard
key={legacyLib.libraryKey}
legacyLib={legacyLib}
destinationName={destination.title}
/>
))}
</Container>
);