mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* first version of the pack * single entry point * add custom components to the package * move form components to toolkit * add more utils and hooks to the package * minor fixes * add CI workflow * update readme and package.json * fix ts * fix build of env-validator * fix docker build * fix icons size * test fixes * more test fixes
34 lines
864 B
TypeScript
34 lines
864 B
TypeScript
import { Box } from '@chakra-ui/react';
|
|
import React from 'react';
|
|
|
|
import type { ContractAbiItemInput } from '../types';
|
|
|
|
import { Hint } from 'toolkit/components/Hint/Hint';
|
|
|
|
import { getFieldLabel } from './utils';
|
|
|
|
interface Props {
|
|
data: ContractAbiItemInput;
|
|
isOptional?: boolean;
|
|
level: number;
|
|
}
|
|
|
|
const ContractMethodFieldLabel = ({ data, isOptional, level }: Props) => {
|
|
return (
|
|
<Box
|
|
w="250px"
|
|
textStyle="sm"
|
|
py="6px"
|
|
flexShrink={ 0 }
|
|
fontWeight={ 500 }
|
|
color={ level > 1 ? { _light: 'blackAlpha.600', _dark: 'whiteAlpha.600' } : undefined }
|
|
wordBreak="break-all"
|
|
>
|
|
{ getFieldLabel(data, !isOptional) }
|
|
{ data.type === 'string' && <Hint label={ `The "" string will be treated as an empty string` } ml={ 2 }/> }
|
|
</Box>
|
|
);
|
|
};
|
|
|
|
export default React.memo(ContractMethodFieldLabel);
|