two-column-with-image.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import Image from "next/image";
  2. export default function TwoColumnWithImage({
  3. headline,
  4. subheadline,
  5. image,
  6. imagePosition,
  7. scrollAnchorId,
  8. }) {
  9. return (
  10. <section id={scrollAnchorId} className="cta-section">
  11. <div className="container">
  12. <div className="row">
  13. {image && imagePosition === "left" && (
  14. <div className="col-lg-6 order-last order-lg-first">
  15. <div className="left-image cta-image ">
  16. <Image
  17. src={`/images/${image}`}
  18. height={400}
  19. width={600}
  20. alt=""
  21. sizes="100vw"
  22. style={{
  23. width: "100%",
  24. height: "auto",
  25. }}
  26. />
  27. </div>
  28. </div>
  29. )}
  30. <div className="col-lg-6">
  31. <div className="cta-content-wrapper">
  32. <div className="section-title">
  33. <h2 className="mb-20">{headline}</h2>
  34. <div
  35. style={{ color: "rgba(0,0,0,0.7)" }}
  36. dangerouslySetInnerHTML={{ __html: subheadline }}
  37. />
  38. </div>
  39. </div>
  40. </div>
  41. {image && imagePosition === "right" && (
  42. <div className="col-lg-6">
  43. <div className="right-image cta-image text-lg-end">
  44. <Image
  45. src={`/images/${image}`}
  46. height={400}
  47. width={600}
  48. alt=""
  49. sizes="100vw"
  50. style={{
  51. width: "100%",
  52. height: "auto",
  53. }}
  54. />
  55. </div>
  56. </div>
  57. )}
  58. </div>
  59. </div>
  60. </section>
  61. );
  62. }