diff --git a/drc-portals/app/data/processed/dcc_asset/[id]/modules.tsx b/drc-portals/app/data/processed/dcc_asset/[id]/modules.tsx new file mode 100644 index 000000000..8c2685d94 --- /dev/null +++ b/drc-portals/app/data/processed/dcc_asset/[id]/modules.tsx @@ -0,0 +1,27 @@ +/** + * All analyze modules, a function defines whether the module itself is compatible, + * and the button defines what to show. + */ +import PWBButton from "@/app/data/processed/PWBButton"; +import prisma from "@/lib/prisma"; +import { cache } from "react"; + +const modules: { + compatible: (item: { id: string, node: { label: string; description: string; }, asset_type: string }) => boolean, + button: (props: { item: { id: string,node: { label: string; description: string; }, asset_type: string } }) => React.ReactNode, +}[] = [ + { + compatible: (item) => true, + button: async ({ item }) => The Playbook Workflow Builder helps you interactively construct workflows leveraging CFDE APIs without code. Start a new workflow with {item.node.label}.} + />, + }, +] +export default modules diff --git a/drc-portals/app/data/processed/dcc_asset/[id]/page.tsx b/drc-portals/app/data/processed/dcc_asset/[id]/page.tsx index 4d6c4daf3..927277a02 100644 --- a/drc-portals/app/data/processed/dcc_asset/[id]/page.tsx +++ b/drc-portals/app/data/processed/dcc_asset/[id]/page.tsx @@ -3,7 +3,10 @@ import Link from "next/link" import { format_description, type_to_string } from "@/app/data/processed/utils"; import LandingPageLayout from "@/app/data/processed/LandingPageLayout"; import { Metadata, ResolvingMetadata } from 'next' +import Grid from "@mui/material/Grid"; +import Typography from "@mui/material/Typography"; import { cache } from "react"; +import modules from "./modules"; type PageProps = { params: { id: string } } @@ -73,6 +76,17 @@ export default async function Page(props: { params: { id: string } }) { item.dcc_asset.fileAsset ? { label: 'Size in Bytes', value: item.dcc_asset.fileAsset.size?.toLocaleString() ?? 'unknown' } : null, { label: 'Last Modified', value: item.dcc_asset.lastmodified.toLocaleDateString() }, ]} - /> + > + + + Analyze + + + {modules + .filter(({ compatible }) => compatible({ id: props.params.id, node: item.node })) + .map(({ button: ModButton }, i) => )} + + + ) }