33
shared/editor/embeds/GoogleForms.tsx
Normal file
33
shared/editor/embeds/GoogleForms.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import * as React from "react";
|
||||
import Frame from "../components/Frame";
|
||||
import Image from "../components/Image";
|
||||
import { EmbedProps as Props } from ".";
|
||||
|
||||
function GoogleForms(props: Props) {
|
||||
return (
|
||||
<Frame
|
||||
{...props}
|
||||
src={props.attrs.href.replace(
|
||||
/\/(edit|viewform)(\?.+)?$/,
|
||||
"/viewform?embedded=true"
|
||||
)}
|
||||
icon={
|
||||
<Image
|
||||
src="/images/google-forms.png"
|
||||
alt="Google Forms Icon"
|
||||
width={16}
|
||||
height={16}
|
||||
/>
|
||||
}
|
||||
canonicalUrl={props.attrs.href}
|
||||
title="Google Forms"
|
||||
border
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
GoogleForms.ENABLED = [
|
||||
new RegExp("^https?://docs\\.google\\.com/forms/d/(.+)$"),
|
||||
];
|
||||
|
||||
export default GoogleForms;
|
||||
Reference in New Issue
Block a user