From ffe7fe7b3d768221900f487154710713557a5f7a Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Tue, 23 Sep 2025 17:37:21 -0500 Subject: [PATCH] Refine config list display --- .../config/AdminAppConfigurationClient.tsx | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/admin/config/AdminAppConfigurationClient.tsx b/src/admin/config/AdminAppConfigurationClient.tsx index 295f07ae..4cbfd9c4 100644 --- a/src/admin/config/AdminAppConfigurationClient.tsx +++ b/src/admin/config/AdminAppConfigurationClient.tsx @@ -20,7 +20,10 @@ import EnvVar from '@/components/EnvVar'; import AdminLink from '@/admin/AdminLink'; import ScoreCardContainer from '@/components/ScoreCardContainer'; import { CATEGORY_KEYS, DEFAULT_CATEGORY_KEYS } from '@/category'; -import { AI_AUTO_GENERATED_FIELDS_ALL } from '@/photo/ai'; +import { + AI_AUTO_GENERATED_FIELDS_ALL, + AI_AUTO_GENERATED_FIELDS_DEFAULT, +} from '@/photo/ai'; import clsx from 'clsx/lite'; import Link from 'next/link'; import { PATH_FEED_JSON, PATH_RSS_XML } from '@/app/path'; @@ -239,6 +242,15 @@ export default function AdminAppConfigurationClient({ includeTooltip={includeTooltip} />; + const renderCommaSeparatedList = (items: string[]) => + <> + {'"'} + {items.map((item, index) => + {item}{index < items.length - 1 ? <>,​ : <>} + )} + {'"'} + ; + const renderGroupContent = (key: ConfigSectionKey): JSX.Element => { switch (key) { case 'Storage': @@ -495,7 +507,9 @@ export default function AdminAppConfigurationClient({ uploading photos. Accepted values: title, caption, tags, description, all, or none {' '} - (default: {'"title,tags,semantic"'}): + (default: {renderCommaSeparatedList( + AI_AUTO_GENERATED_FIELDS_DEFAULT, + )}): {renderEnvVars(['AI_TEXT_AUTO_GENERATED_FIELDS'])} {renderEnvVars(['NEXT_PUBLIC_CATEGORY_VISIBILITY'])} @@ -866,7 +880,7 @@ export default function AdminAppConfigurationClient({ Configure order and visibility of social networks (seen in share modal) by storing comma-separated values (accepts {'"all"'} or {'"none"'}, - defaults to {`"${DEFAULT_SOCIAL_KEYS.join(',')}"`}) + defaults to {renderCommaSeparatedList(DEFAULT_SOCIAL_KEYS)}) {renderEnvVars(['NEXT_PUBLIC_SOCIAL_NETWORKS'])}