mirror of
https://github.com/ritz078/transform.git
synced 2026-11-21 00:32:56 +03:00
* init * flow to javascript * add to menu * fix ts to js * add "plain" to menu labels * cleanup * comments
32 lines
815 B
TypeScript
32 lines
815 B
TypeScript
import ConversionPanel from "@components/ConversionPanel";
|
|
import * as React from "react";
|
|
import { useCallback } from "react";
|
|
import request from "@utils/request";
|
|
import { Alert } from "evergreen-ui";
|
|
|
|
export default function FlowToJavascript() {
|
|
const transformer = useCallback(
|
|
({ value }) => request("/api/flow-to-javascript", value, "plain/text"),
|
|
[]
|
|
);
|
|
|
|
return (
|
|
<ConversionPanel
|
|
transformer={transformer}
|
|
editorTitle="Flow"
|
|
editorLanguage="plaintext"
|
|
editorDefaultValue="flow"
|
|
resultTitle="JavaScript"
|
|
resultLanguage={"javascript"}
|
|
resultEditorProps={{
|
|
topNotifications: () => (
|
|
<Alert
|
|
backgroundColor="#e7f7ff"
|
|
title="This code is converted on the server."
|
|
/>
|
|
)
|
|
}}
|
|
/>
|
|
);
|
|
}
|