forked from ant-design/md-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChartAttrToolBarStyle.ts
47 lines (44 loc) · 1013 Bytes
/
ChartAttrToolBarStyle.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
import {
ChatTokenType,
GenerateStyle,
useEditorStyleRegister,
} from '../../../utils/useStyle';
const genStyle: GenerateStyle<ChatTokenType> = (token) => {
return {
[token.componentCls]: {
display: 'flex',
justifyContent: 'flex-end',
alignItems: 'center',
padding: '6px 8px',
width: '100%',
borderBottom: '1px solid rgba(77, 77, 77, 0.03)',
zIndex: 10,
gap: '4px',
'&-item': {
display: 'flex',
alignItems: 'center',
gap: '4px',
padding: '4px',
borderRadius: '12px',
cursor: 'pointer',
'&:hover': {
backgroundColor: 'rgb(209 213 219 / 0.4)',
},
},
},
};
};
/**
* AgentChat
* @param prefixCls
* @returns
*/
export function useStyle(prefixCls?: string) {
return useEditorStyleRegister('ChartAttr-' + prefixCls, (token) => {
const editorToken = {
...token,
componentCls: `.${prefixCls}`,
};
return [genStyle(editorToken)];
});
}