Add plan mode to show character comments in the table

This commit is contained in:
Calli
2023-10-02 12:29:32 +03:00
parent 1d75dfb286
commit 77af55ce2f
8 changed files with 81 additions and 20 deletions

View File

@@ -2,9 +2,13 @@ import { AccessToken } from "@/types";
import { Box, Stack, Typography, useTheme } from "@mui/material";
import { CharacterRow } from "../Characters/CharacterRow";
import { PlanetaryInteractionRow } from "../PlanetaryInteraction/PlanetaryInteractionRow";
import { SessionContext } from "@/app/context/Context";
import { useContext } from "react";
import { PlanRow } from "./PlanRow";
export const AccountCard = ({ characters }: { characters: AccessToken[] }) => {
const theme = useTheme();
const { planMode } = useContext(SessionContext);
return (
<Box
sx={{
@@ -24,7 +28,11 @@ export const AccountCard = ({ characters }: { characters: AccessToken[] }) => {
alignItems="flex-start"
>
<CharacterRow character={c} />
<PlanetaryInteractionRow character={c} />
{planMode ? (
<PlanRow character={c} />
) : (
<PlanetaryInteractionRow character={c} />
)}
</Stack>
))}
</Box>