aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/app/components/Gaming/CodePopover.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/app/components/Gaming/CodePopover.tsx')
-rw-r--r--frontend/app/components/Gaming/CodePopover.tsx8
1 files changed, 5 insertions, 3 deletions
diff --git a/frontend/app/components/Gaming/CodePopover.tsx b/frontend/app/components/Gaming/CodePopover.tsx
index a574a77..91245df 100644
--- a/frontend/app/components/Gaming/CodePopover.tsx
+++ b/frontend/app/components/Gaming/CodePopover.tsx
@@ -2,15 +2,17 @@ import { Popover } from "@base-ui-components/react/popover";
import { faCode, faXmark } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { calcCodeSize } from "../../states/play";
+import type { SupportedLanguage } from "../../types/SupportedLanguage";
import BorderedContainer from "../BorderedContainer";
import CodeBlock from "../Gaming/CodeBlock";
type Props = {
code: string;
+ language: SupportedLanguage;
};
-export default function CodePopover({ code }: Props) {
- const codeSize = calcCodeSize(code);
+export default function CodePopover({ code, language }: Props) {
+ const codeSize = calcCodeSize(code, language);
return (
<Popover.Root>
@@ -33,7 +35,7 @@ export default function CodePopover({ code }: Props) {
/>
</Popover.Close>
</div>
- <CodeBlock code={code} language="php" />
+ <CodeBlock code={code} language={language} />
</BorderedContainer>
</Popover.Popup>
</Popover.Positioner>