feat: Add DBdiagram (dbdiagram.io) embed (#3124)

* Add dbdiagram embed

* clean variable name
This commit is contained in:
Nonpawit Teerachetmongkol
2022-02-17 09:04:44 +07:00
committed by GitHub
parent 7e216109dc
commit 3760a03c44
3 changed files with 30 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
import * as React from "react";
import Frame from "./components/Frame";
import { EmbedProps as Props } from ".";
export default class DBDiagram extends React.Component<Props> {
static ENABLED = [new RegExp("https://dbdiagram.io/(embed|d)/(\\w+)$")];
render() {
const { matches } = this.props.attrs;
const shareId = matches[2];
return (
<Frame
{...this.props}
src={`https://dbdiagram.io/embed/${shareId}`}
title={`DBDiagram (${shareId})`}
width="100%"
height="400px"
/>
);
}
}