1
1
import styled from "styled-components" ;
2
- import { ResourceType } from "@lowcoder-ee/constants/queryConstants" ;
3
- import { BottomResTypeEnum } from "types/bottomRes" ;
2
+ import { ResourceType } from "@lowcoder-ee/constants/queryConstants" ;
3
+ /* import {
4
+ ClickHouseIcon,
5
+ DataResponderIcon,
6
+ DeleteApiIcon,
7
+ EsIcon,
8
+ FileFolderIcon,
9
+ GetApiIcon,
10
+ GoogleSheetsIcon,
11
+ GraphqlIcon,
12
+ HeadApiIcon,
13
+ JSIcon,
14
+ MariaDBIcon,
15
+ MongoIcon,
16
+ MSSQLIcon,
17
+ MysqlIcon,
18
+ LowcoderQueryIcon,
19
+ OptionsApiIcon,
20
+ OracleIcon,
21
+ PatchApiIcon,
22
+ PostApiIcon,
23
+ PostgresIcon,
24
+ PutApiIcon,
25
+ QueryLibraryIcon,
26
+ RedisIcon,
27
+ RestApiIcon,
28
+ SMTPIcon,
29
+ SnowflakeIcon,
30
+ TempStateIcon,
31
+ TraceApiIcon,
32
+ TransformerIcon,
33
+ } from "lowcoder-design"; */
34
+ import { BottomResTypeEnum } from "types/bottomRes" ;
35
+ import { HttpMethod } from "api/api" ;
36
+
37
+ /* const QueryLibrary = styled(QueryLibraryIcon)`
38
+ g g g {
39
+ stroke: #222222;
40
+ }
41
+ `; */
4
42
5
43
export const IconWrapper = styled . div < { $isRestApi ?: boolean } > `
6
44
display: flex;
@@ -18,3 +56,75 @@ export type BottomResType =
18
56
| BottomResTypeEnum . Transformer
19
57
| BottomResTypeEnum . Folder
20
58
| BottomResTypeEnum . DateResponder ;
59
+
60
+ /* const HttpMethodIcon = {
61
+ DELETE: <DeleteApiIcon />,
62
+ GET: <GetApiIcon />,
63
+ PATCH: <PatchApiIcon />,
64
+ POST: <PostApiIcon />,
65
+ PUT: <PutApiIcon />,
66
+ HEAD: <HeadApiIcon />,
67
+ OPTIONS: <OptionsApiIcon />,
68
+ TRACE: <TraceApiIcon />,
69
+ }; */
70
+
71
+ export const getBottomResIcon = (
72
+ type : BottomResType ,
73
+ size ?: "middle" | "large" ,
74
+ defaultIconUrl ?: string ,
75
+ httpMethod ?: HttpMethod
76
+ ) => {
77
+ /* const getIcon = () => {
78
+ switch (type) {
79
+ case BottomResTypeEnum.TempState:
80
+ return <TempStateIcon />;
81
+ case BottomResTypeEnum.Transformer:
82
+ return <TransformerIcon />;
83
+ case BottomResTypeEnum.DateResponder:
84
+ return <DataResponderIcon />;
85
+ case BottomResTypeEnum.Folder:
86
+ return <FileFolderIcon />;
87
+ case "mysql":
88
+ return <MysqlIcon />;
89
+ case "mongodb":
90
+ return <MongoIcon />;
91
+ case "restApi":
92
+ return httpMethod ? HttpMethodIcon[httpMethod] : <RestApiIcon />;
93
+ case "postgres":
94
+ return <PostgresIcon />;
95
+ case "js":
96
+ return <JSIcon />;
97
+ case "redis":
98
+ return <RedisIcon />;
99
+ case "es":
100
+ return <EsIcon />;
101
+ case "mssql":
102
+ return <MSSQLIcon />;
103
+ case "smtp":
104
+ return <SMTPIcon />;
105
+ case "oracle":
106
+ return <OracleIcon />;
107
+ case "clickHouse":
108
+ return <ClickHouseIcon />;
109
+ case "libraryQuery":
110
+ return <QueryLibrary />;
111
+ case "googleSheets":
112
+ return <GoogleSheetsIcon />;
113
+ case "graphql":
114
+ return <GraphqlIcon />;
115
+ case "lowcoderApi":
116
+ return <LowcoderQueryIcon />;
117
+ case "snowflake":
118
+ return <SnowflakeIcon />;
119
+ case "mariadb":
120
+ return <MariaDBIcon />;
121
+ default:
122
+ if (defaultIconUrl) {
123
+ return getBottomResIconInnerByUrl(type, defaultIconUrl);
124
+ }
125
+ return <RestApiIcon />;
126
+ }
127
+ }; */
128
+
129
+ return < IconWrapper > </ IconWrapper > ;
130
+ } ;
0 commit comments