Event.tsx 797 B

123456789101112131415161718192021222324252627282930
  1. // Copyright 2017-2020 @polkadot/app-explorer authors & contributors
  2. // This software may be modified and distributed under the terms
  3. // of the Apache-2.0 license. See the LICENSE file for details.
  4. import { EventRecord } from '@polkadot/types/interfaces';
  5. import React from 'react';
  6. import { Event as EventDisplay, Expander } from '@polkadot/react-components';
  7. interface Props {
  8. className?: string;
  9. value: EventRecord;
  10. }
  11. function Event ({ className = '', value: { event } }: Props): React.ReactElement<Props> {
  12. return (
  13. <Expander
  14. className={className}
  15. summary={`${event.section}.${event.method}`}
  16. summaryMeta={event.meta}
  17. >
  18. <EventDisplay
  19. className='details'
  20. value={event}
  21. />
  22. </Expander>
  23. );
  24. }
  25. export default React.memo(Event);