mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
fixed eslint warnings
This commit is contained in:
parent
58fa40dd5c
commit
ba2e610e01
16 changed files with 82 additions and 585 deletions
|
@ -1,16 +1,16 @@
|
|||
import React, { FC, memo, useMemo } from "react";
|
||||
import { ICommentBlockProps } from "~/constants/comment";
|
||||
import styles from "./styles.module.scss";
|
||||
import { getYoutubeThumb } from "~/utils/dom";
|
||||
import { Icon } from "~/components/input/Icon";
|
||||
import { useYoutubeMetadata } from "~/hooks/metadata/useYoutubeMetadata";
|
||||
import React, { FC, memo, useMemo } from 'react';
|
||||
import { ICommentBlockProps } from '~/constants/comment';
|
||||
import styles from './styles.module.scss';
|
||||
import { getYoutubeThumb } from '~/utils/dom';
|
||||
import { Icon } from '~/components/input/Icon';
|
||||
import { useYoutubeMetadata } from '~/hooks/metadata/useYoutubeMetadata';
|
||||
|
||||
type Props = ICommentBlockProps & {};
|
||||
|
||||
const CommentEmbedBlock: FC<Props> = memo(({ block }) => {
|
||||
const id = useMemo(() => {
|
||||
const match = block.content.match(
|
||||
/https?:\/\/(?:www\.)?(?:youtube\.com|youtu\.be)\/(?:watch)?(?:\?v=)?([\w\-\=]+)/
|
||||
/https?:\/\/(?:www\.)?(?:youtube\.com|youtu\.be)\/(?:watch)?(?:\?v=)?([\w\-=]+)/
|
||||
);
|
||||
|
||||
return (match && match[1]) || '';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue