msg.js 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. import { View } from 'app/design/view'
  2. import { BlockWrapper } from 'app/components/block-wrapper'
  3. import Html from 'app/ui/atoms/html';
  4. export default function ElementMsg({ data, msg_type, blockWrapperProps }) {
  5. if (!data.length)
  6. return null;
  7. let clsname = "bg-accent p-3 rounded-xl";
  8. let clsname1 = "text-accent-foreground text-center";
  9. if (msg_type == 'caption') {
  10. clsname = " ";
  11. clsname1 = "text-card-foreground";
  12. }
  13. if (msg_type == 'result') {
  14. clsname = "";
  15. clsname1 = "text-card-foreground text-center";
  16. }
  17. if (msg_type == 'info') {
  18. clsname = "px-4 py-2 sm:px-6 sm:py-4 mb-4 rounded-none lg:rounded-2xl sm:border border-border/60 backgrop-blur web:duration-200 overflow-hidden rounded-2xl bg-card mx-4";
  19. clsname1 = "text-card-foreground text-center";
  20. }
  21. return (
  22. <BlockWrapper {...blockWrapperProps}>
  23. <View className={clsname}>
  24. <Html className={clsname1} data={data}/>
  25. </View>
  26. </BlockWrapper>
  27. );
  28. }