Files
explore/ui/shared/logs/LogDecodedInputData.tsx
T
tom goriunovandGitHub d02a3f707f User Operations: add switcher to call data (#1950)
* User Operations: add switcher to call data

Fixes #1762

* update screenshots

* move toggler above decoded method signature on mobile
2024-05-27 14:18:44 +02:00

32 lines
917 B
TypeScript

import React from 'react';
import type { DecodedInput } from 'types/api/decodedInput';
import useIsMobile from 'lib/hooks/useIsMobile';
import LogDecodedInputDataHeader from './LogDecodedInputDataHeader';
import LogDecodedInputDataTable from './LogDecodedInputDataTable';
interface Props {
data: DecodedInput;
isLoading?: boolean;
rightSlot?: React.ReactNode;
}
const LogDecodedInputData = ({ data, isLoading, rightSlot }: Props) => {
const isMobile = useIsMobile();
return (
<>
{ isMobile ? rightSlot : null }
<LogDecodedInputDataHeader
methodId={ data.method_id }
methodCall={ data.method_call }
isLoading={ isLoading }
rightSlot={ isMobile ? null : rightSlot }
/>
{ data.parameters.length > 0 && <LogDecodedInputDataTable data={ data.parameters } isLoading={ isLoading }/> }
</>
);
};
export default React.memo(LogDecodedInputData);