Files
outline/shared/editor/embeds/Grist.tsx
2023-10-14 09:22:57 -04:00

31 lines
678 B
TypeScript

import * as React from "react";
import Frame from "../components/Frame";
import Image from "../components/Img";
import { EmbedProps as Props } from ".";
function Grist(props: Props) {
return (
<Frame
{...props}
src={props.attrs.href.replace(/(\?embed=true)?$/, "?embed=true")}
icon={
<Image
src="/images/grist.png"
alt="Grist Icon"
width={16}
height={16}
/>
}
title="Grist Spreadsheet"
canonicalUrl={props.attrs.href}
border
/>
);
}
Grist.ENABLED = [new RegExp("^https?://([a-z.-]+\\.)?getgrist\\.com/(.+)$")];
Grist.URL_PATH_REGEX = /(.+)/;
export default Grist;