mirror of
https://github.com/optim-enterprises-bv/OptimCloud-gw-ui.git
synced 2025-11-02 03:07:46 +00:00
36 lines
976 B
TypeScript
36 lines
976 B
TypeScript
import * as React from 'react';
|
|
import { IconButton, Tooltip, useDisclosure } from '@chakra-ui/react';
|
|
import { Article } from 'phosphor-react';
|
|
import { useTranslation } from 'react-i18next';
|
|
import SystemLoggingModal from './Modal';
|
|
import { EndpointApiResponse } from 'hooks/Network/Endpoints';
|
|
|
|
type Props = {
|
|
endpoint: EndpointApiResponse;
|
|
token: string;
|
|
};
|
|
|
|
const SystemLoggingButton = ({ endpoint, token }: Props) => {
|
|
const { t } = useTranslation();
|
|
const modalProps = useDisclosure();
|
|
|
|
return (
|
|
<>
|
|
<Tooltip label={t('system.logging')} hasArrow>
|
|
<IconButton
|
|
aria-label={t('system.logging')}
|
|
colorScheme="teal"
|
|
type="button"
|
|
my="auto"
|
|
onClick={modalProps.onOpen}
|
|
icon={<Article size={20} />}
|
|
mr={2}
|
|
/>
|
|
</Tooltip>
|
|
<SystemLoggingModal modalProps={modalProps} endpoint={endpoint.uri} token={token} />
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default SystemLoggingButton;
|