Files
outline/shared/editor/embeds/PlantUml.tsx
patroldoandTom Moor c33d9fd6ec Added plantuml embedding (#10379)
* Added plantuml embedding

* Added plantUML icon

* Updated alt of plantuml icon

* Removed edit button, fixed plantuml placeholder and replaced image url

* tweaks

---------

Co-authored-by: Tom Moor <tom@getoutline.com>
2025-10-17 23:13:42 -04:00

32 lines
769 B
TypeScript

import * as React from "react";
import Frame from "../components/Frame";
import Image from "../components/Img";
import { EmbedProps as Props } from ".";
import { useTheme } from "styled-components";
function PlantUmlDiagrams({ matches, ...props }: Props) {
const theme = useTheme();
const mode = theme.isDark ? "dsvg" : "svg";
const title = props.attrs.href.split("/uml/")[1];
const finalUrl = `https://www.plantuml.com/plantuml/${mode}/${title}`;
return (
<Frame
{...props}
src={finalUrl}
icon={
<Image
src="/images/plantuml.png"
alt="PlantUml"
width={16}
height={16}
/>
}
canonicalUrl={props.attrs.href}
border
/>
);
}
export default PlantUmlDiagrams;