forked from ant-design/md-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtableAttrStyle.ts
53 lines (50 loc) · 1.21 KB
/
tableAttrStyle.ts
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
import {
ChatTokenType,
GenerateStyle,
resetComponent,
useEditorStyleRegister,
} from '../utils/useStyle';
const genStyle: GenerateStyle<ChatTokenType> = (token) => {
return {
[token.componentCls]: {
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
padding: '4px 8px',
borderBottom: '1px solid #e5e7eb',
backgroundColor: 'rgba(255, 255, 255, 1)',
border: '1px solid #f0f0f0',
boxShadow: '0 1px 2px 0 rgb(0 0 0 / 5%)',
position: 'absolute',
zIndex: 10,
gap: '4px',
borderRadius: '12px',
'&-item': {
display: 'flex',
fontSize: '1.1em',
alignItems: 'center',
gap: '4px',
padding: '4px',
borderRadius: '8px',
cursor: 'pointer',
'&:hover': {
backgroundColor: 'rgb(209 213 219 / 0.4)',
},
},
},
};
};
/**
* AgentChat
* @param prefixCls
* @returns
*/
export function useStyle(prefixCls?: string) {
return useEditorStyleRegister('TableAttr-' + prefixCls, (token) => {
const editorToken = {
...token,
componentCls: `.${prefixCls}`,
};
return [resetComponent(editorToken), genStyle(editorToken)];
});
}