Untitled

mail@pastecode.io avatar
unknown
javascript
20 days ago
1.1 kB
0
Indexable
Never
import { toHTML } from "~/ui/Utils/richtextToHTML";
import { cn } from "~/utils";
import React from "react";
import { MemoizedFields } from "../types/listingPageTypes";

interface ContentProps {
  memoizedFields: MemoizedFields;
  hasVideo: boolean;
  className?: string;
}

const ContentListingPage: React.FC<ContentProps> = React.memo(({ memoizedFields, hasVideo, className }) => (
  <div 
    className={`flex flex-col gap-2 font-light pb-6 ${hasVideo ? 'md:max-w-[445px]' : ''} ${className}`} 
    data-element="preferiti-di-cristina-content"
  >
    {memoizedFields.titolo_menu && (
      <span className="hidden md:block text-[14px] leading-[18px] font-bold text-rhodamine uppercase">
        {memoizedFields.titolo_menu.value}
      </span>
    )}
    {memoizedFields.titolo_pagina && <h3 className="bold">{memoizedFields.titolo_pagina.value}</h3>}
    {memoizedFields.descrizione_pagina && (
      <div
        className="text-left"
        dangerouslySetInnerHTML={{
          __html: toHTML(memoizedFields.descrizione_pagina.value),
        }}
      ></div>
    )}
  </div>
));

export default ContentListingPage;
Leave a Comment