diff --git a/frontend/src/page/admin/GuildDetails.tsx b/frontend/src/page/admin/GuildDetails.tsx index 3a753ba..3d1fb08 100644 --- a/frontend/src/page/admin/GuildDetails.tsx +++ b/frontend/src/page/admin/GuildDetails.tsx @@ -1,15 +1,52 @@ import {fetchGuildDetails, GuildDetails as GuildDetailsDto} from "../../service/api"; import {Base} from "../../component/Base"; -import {Container, Paper, Stack, TextField, Typography} from "@mui/material"; +import { + Accordion, + AccordionDetails, + AccordionSummary, + Container, + Paper, + Stack, + TextField, + Typography +} from "@mui/material"; import {useParams} from "react-router-dom"; import React, {Suspense, use} from "react"; import {getGuildNameElement} from "../../guildUtil"; import {DataGrid, GridColDef} from "@mui/x-data-grid"; +import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; +import {parseISO} from "date-fns"; +import {format} from "date-fns/format"; interface GuildDetailsDataProps { dataPromise: Promise } +function FeaturesPaper({dataPromise}: GuildDetailsDataProps) { + const data = use(dataPromise).features; + + const enabledFeatures = data.enabledFeatures.map(f => { + const enabledAt = format(parseISO(f.enabledAt), 'MM/dd/yyyy'); + + return + }> + {f.name} (enabled: {enabledAt}) + + + Enabled by: {f.enabledBy} + Data: {JSON.stringify(f.data)} + + ; + }); + + return + Features +
+ {enabledFeatures} +
+
; +} + function TagsDataPaper({dataPromise}: GuildDetailsDataProps) { const data = use(dataPromise); @@ -62,10 +99,15 @@ export default function GuildDetails() { - + Loading...}> + + Loading...}> + + + } diff --git a/frontend/src/service/api.ts b/frontend/src/service/api.ts index 288140a..b78e2de 100644 --- a/frontend/src/service/api.ts +++ b/frontend/src/service/api.ts @@ -77,7 +77,7 @@ export interface Tag { export interface Feature { name: string, data: any, - enableBy: string, + enabledBy: string, enabledAt: string, }