Skip to content

Commit

Permalink
import
Browse files Browse the repository at this point in the history
  • Loading branch information
isaaclombardssw committed Jan 10, 2025
1 parent d8eefdc commit 7b5c544
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions components/blocks/imageComponents/ImageComponentLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
"use client";
import { Container } from "@/components/util/container";
import getYouTubeVideoId from "@/services/client/youtube.service";
import "aos/dist/aos.css";
import Image from "next/image";
import { classNames } from "tinacms";
import { tinaField } from "tinacms/dist/react";
import V2ComponentWrapper from "../../layout/v2ComponentWrapper";

const getYouTubeVideoId = (url: string) => {
if (!url) return null;
// Handle different YouTube URL formats
const regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/;
const match = url.match(regExp);
return match && match[2].length === 11 ? match[2] : null;
};

export const ImageComponentLayout = ({ data, children }) => {
const imageIsLeftAligined = data.mediaConfiguration?.placement === "Left";
const isYouTube = data.mediaConfiguration?.mediaType === "youtube";
Expand Down

0 comments on commit 7b5c544

Please sign in to comment.