Files
Frontend/src/app/components/code-dialog.tsx
Liam 0f304b22b1
All checks were successful
Deploy App / docker (ubuntu-latest) (push) Successful in 1m26s
updated search look for player and server page
2024-04-18 05:18:25 +01:00

35 lines
1.0 KiB
TypeScript

import { ReactElement } from "react";
import SyntaxHighlighter from "react-syntax-highlighter";
import { atelierSeasideDark } from "react-syntax-highlighter/dist/esm/styles/hljs";
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger } from "./ui/dialog";
type CodeDialogProps = {
title: string;
description: string;
code: string;
children: React.ReactNode;
};
export function CodeDialog({ title, description, code, children }: CodeDialogProps): ReactElement {
return (
<Dialog>
<DialogTrigger asChild>{children}</DialogTrigger>
<DialogContent className="max-h-[700px]">
<DialogHeader>
<DialogTitle>{title}</DialogTitle>
<DialogDescription>{description}</DialogDescription>
</DialogHeader>
<SyntaxHighlighter
language="javascript"
style={atelierSeasideDark}
customStyle={{
maxHeight: "600px",
}}
>
{code}
</SyntaxHighlighter>
</DialogContent>
</Dialog>
);
}