gitscope
← marzneshin / v0.2.0 / app/dashboard/src/pages/nodes/table/action-buttons.tsx
https://dev.kronoz.win/r/marzneshin.git
app/dashboard/src/pages/nodes/table/action-buttons.tsx · TypeScript
Blame Raw
 1
 2import { t } from 'i18next';
 3import { Cog6ToothIcon } from '@heroicons/react/24/outline';
 4import { chakra, HStack, IconButton, Tooltip } from '@chakra-ui/react';
 5import { NodeType, useCoreSettings } from 'stores';
 6import { FC } from 'react';
 7
 8const iconProps = {
 9  baseStyle: {
10    w: 4,
11    h: 4,
12  },
13};
14const CoreSettingsIcon = chakra(Cog6ToothIcon, iconProps);
15
16type ActionButtonsProps = {
17  node: NodeType,
18};
19
20export const ActionButtons: FC<ActionButtonsProps> = ({ node }) => {
21  return (
22    <HStack
23      justifyContent="flex-end"
24      onClick={(e) => {
25        e.preventDefault();
26        e.stopPropagation();
27      }}
28    >
29      <Tooltip
30        label={
31          t('nodesTable.coreSettings')
32        }
33        placement="top"
34      >
35        <IconButton
36          p="0 !important"
37          aria-label="core settings"
38          bg="transparent"
39          _dark={{
40            _hover: {
41              bg: 'gray.700',
42            },
43          }}
44          size={{
45            base: 'sm',
46            md: 'md',
47          }}
48          onClick={() => {
49            useCoreSettings.setState({ selectedNode: node });
50          }}
51        >
52          <CoreSettingsIcon />
53        </IconButton>
54      </Tooltip>
55    </HStack >
56  );
57};