mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* User Operations: add switcher to call data Fixes #1762 * update screenshots * move toggler above decoded method signature on mobile
32 lines
917 B
TypeScript
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);
|