Skip to content

Commit

Permalink
Update ContentRendererClient.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
vijaysingh2219 committed Apr 16, 2024
1 parent 8a4b86e commit 0aa0583
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/admin/ContentRendererClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import { useMemo, useState } from 'react';
import { handleMarkAsCompleted } from '@/lib/utils';
import YoutubeRenderer from '../YoutubeRenderer';

const isYouTubeUrl = (url: string): boolean => {
const isYouTubeUrl = (url: string) => {
const youtubePattern: RegExp =
/(?:youtu|youtube)(?:\.com|\.be)\/(?:watch\?v=)?([\w-]+)/;
return youtubePattern.test(url);
};

const extractYouTubeIdFromUrl = (url: string): string | null => {
const extractYouTubeIdFromUrl = (url: string) => {
const match: RegExpMatchArray | null = url.match(
/(?:youtu\.be\/|(?:youtube\.com\/(?:v\/|u\/\w\/|embed\/|watch\?v=)))([\w-]+)/,
);
Expand Down

0 comments on commit 0aa0583

Please sign in to comment.