-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathErrorViews.tsx
58 lines (53 loc) · 1.86 KB
/
ErrorViews.tsx
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
/* eslint no-alert: "off" */
import React, { type CSSProperties } from 'react';
import { ErrorView } from '@deephaven/components';
import SampleSection from './SampleSection';
function ErrorViews(): React.ReactElement {
const columnStyle: CSSProperties = {
maxHeight: 500,
display: 'flex',
flexDirection: 'column',
maxWidth: 400,
};
const shortErrorMessage = 'This is a short error message';
const midErrorMessage = 'Mid length error message\n'.repeat(10);
const longErrorMessage = 'Really long error message\n'.repeat(100);
const midErrorType = 'MidError';
const longErrorType = 'SuperLongErrorMessageType';
return (
<SampleSection name="error-views">
<h2 className="ui-title" title="Display error messages easily">
Error Views
</h2>
<h3>Expandable</h3>
<div className="row" style={{ maxHeight: 500 }}>
<div className="col" style={columnStyle}>
<ErrorView message={shortErrorMessage} />
</div>
<div className="col" style={columnStyle}>
<ErrorView message={midErrorMessage} type={midErrorType} />
</div>
<div className="col" style={columnStyle}>
<ErrorView message={longErrorMessage} type={longErrorType} />
</div>
</div>
<h3>Always expanded</h3>
<div className="row" style={{ maxHeight: 500 }}>
<div className="col" style={columnStyle}>
<ErrorView message={shortErrorMessage} isExpanded />
</div>
<div className="col" style={columnStyle}>
<ErrorView message={midErrorMessage} type={midErrorType} isExpanded />
</div>
<div className="col" style={columnStyle}>
<ErrorView
message={longErrorMessage}
type={longErrorType}
isExpanded
/>
</div>
</div>
</SampleSection>
);
}
export default ErrorViews;