session-desktop/ts/components/conversation/StagedGenericAttachment.md

1.0 KiB

Text file

const attachment = {
  contentType: 'text/plain',
  fileName: 'manifesto.txt',
};

<util.ConversationContext theme={util.theme}>
  <StagedGenericAttachment
    attachment={attachment}
    i18n={util.i18n}
    onClose={attachment => console.log('onClose', attachment)}
  />
</util.ConversationContext>;

File with long name

const attachment = {
  contentType: 'text/plain',
  fileName: 'this-is-my-very-important-manifesto-you-must-read-it.txt',
};

<util.ConversationContext theme={util.theme}>
  <StagedGenericAttachment
    attachment={attachment}
    i18n={util.i18n}
    onClose={attachment => console.log('onClose', attachment)}
  />
</util.ConversationContext>;

File with long extension

const attachment = {
  contentType: 'text/plain',
  fileName: 'manifesto.reallylongtxt',
};

<util.ConversationContext theme={util.theme}>
  <StagedGenericAttachment
    attachment={attachment}
    i18n={util.i18n}
    onClose={attachment => console.log('onClose', attachment)}
  />
</util.ConversationContext>;