|
1 | | -import { ActionIcon, Code, Group, Skeleton, Table, Text } from "@mantine/core"; |
| 1 | +import { |
| 2 | + ActionIcon, |
| 3 | + Box, |
| 4 | + Code, |
| 5 | + Group, |
| 6 | + Skeleton, |
| 7 | + Table, |
| 8 | + Text, |
| 9 | +} from "@mantine/core"; |
2 | 10 | import { useModals } from "@mantine/modals"; |
3 | 11 | import { useEffect, useState } from "react"; |
4 | 12 | import { TbEdit, TbLock } from "react-icons/tb"; |
@@ -43,53 +51,55 @@ const AdminConfigTable = () => { |
43 | 51 | )); |
44 | 52 |
|
45 | 53 | return ( |
46 | | - <Table verticalSpacing="sm" horizontalSpacing="xl" withBorder> |
47 | | - <thead> |
48 | | - <tr> |
49 | | - <th>Key</th> |
50 | | - <th>Value</th> |
51 | | - <th></th> |
52 | | - </tr> |
53 | | - </thead> |
54 | | - <tbody> |
55 | | - {isLoading |
56 | | - ? skeletonRows |
57 | | - : configVariables.map((configVariable) => ( |
58 | | - <tr key={configVariable.key}> |
59 | | - <td style={{ maxWidth: "200px" }}> |
60 | | - <Code>{configVariable.key}</Code>{" "} |
61 | | - {configVariable.secret && <TbLock />} <br /> |
62 | | - <Text size="xs" color="dimmed"> |
63 | | - {configVariable.description} |
64 | | - </Text> |
65 | | - </td> |
66 | | - <td> |
67 | | - {configVariable.obscured |
68 | | - ? "•".repeat(configVariable.value.length) |
69 | | - : configVariable.value} |
70 | | - </td> |
71 | | - <td> |
72 | | - <Group position="right"> |
73 | | - <ActionIcon |
74 | | - color="primary" |
75 | | - variant="light" |
76 | | - size={25} |
77 | | - onClick={() => |
78 | | - showUpdateConfigVariableModal( |
79 | | - modals, |
80 | | - configVariable, |
81 | | - getConfigVariables |
82 | | - ) |
83 | | - } |
84 | | - > |
85 | | - <TbEdit /> |
86 | | - </ActionIcon> |
87 | | - </Group> |
88 | | - </td> |
89 | | - </tr> |
90 | | - ))} |
91 | | - </tbody> |
92 | | - </Table> |
| 54 | + <Box sx={{ display: "block", overflowX: "auto" }}> |
| 55 | + <Table verticalSpacing="sm" horizontalSpacing="xl" withBorder> |
| 56 | + <thead> |
| 57 | + <tr> |
| 58 | + <th>Key</th> |
| 59 | + <th>Value</th> |
| 60 | + <th></th> |
| 61 | + </tr> |
| 62 | + </thead> |
| 63 | + <tbody> |
| 64 | + {isLoading |
| 65 | + ? skeletonRows |
| 66 | + : configVariables.map((configVariable) => ( |
| 67 | + <tr key={configVariable.key}> |
| 68 | + <td style={{ maxWidth: "200px" }}> |
| 69 | + <Code>{configVariable.key}</Code>{" "} |
| 70 | + {configVariable.secret && <TbLock />} <br /> |
| 71 | + <Text size="xs" color="dimmed"> |
| 72 | + {configVariable.description} |
| 73 | + </Text> |
| 74 | + </td> |
| 75 | + <td> |
| 76 | + {configVariable.obscured |
| 77 | + ? "•".repeat(configVariable.value.length) |
| 78 | + : configVariable.value} |
| 79 | + </td> |
| 80 | + <td> |
| 81 | + <Group position="right"> |
| 82 | + <ActionIcon |
| 83 | + color="primary" |
| 84 | + variant="light" |
| 85 | + size={25} |
| 86 | + onClick={() => |
| 87 | + showUpdateConfigVariableModal( |
| 88 | + modals, |
| 89 | + configVariable, |
| 90 | + getConfigVariables |
| 91 | + ) |
| 92 | + } |
| 93 | + > |
| 94 | + <TbEdit /> |
| 95 | + </ActionIcon> |
| 96 | + </Group> |
| 97 | + </td> |
| 98 | + </tr> |
| 99 | + ))} |
| 100 | + </tbody> |
| 101 | + </Table> |
| 102 | + </Box> |
93 | 103 | ); |
94 | 104 | }; |
95 | 105 |
|
|
0 commit comments