Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
* under the License.
*/
import { Flex, type FlexProps } from "@chakra-ui/react";
import { useTheme } from "next-themes";
import ReactJson, { type ReactJsonViewProps } from "react-json-view";

import { ClipboardRoot, ClipboardIconButton } from "src/components/ui";
import { useColorMode } from "src/context/colorMode";

type Props = {
readonly content: object;
Expand All @@ -29,7 +29,7 @@ type Props = {

const RenderedJsonField = ({ content, jsonProps, ...rest }: Props) => {
const contentFormatted = JSON.stringify(content, undefined, 4);
const { theme } = useTheme();
const { colorMode } = useColorMode();

return (
<Flex {...rest}>
Expand All @@ -43,7 +43,7 @@ const RenderedJsonField = ({ content, jsonProps, ...rest }: Props) => {
style={{
backgroundColor: "inherit",
}}
theme={theme === "dark" ? "monokai" : "rjv-default"}
theme={colorMode === "dark" ? "monokai" : "rjv-default"}
{...jsonProps}
/>
<ClipboardRoot value={contentFormatted}>
Expand Down
Loading