diff --git a/client/src/components/Chat/Landing.tsx b/client/src/components/Chat/Landing.tsx index bd2945e242..032c59f538 100644 --- a/client/src/components/Chat/Landing.tsx +++ b/client/src/components/Chat/Landing.tsx @@ -11,6 +11,22 @@ import { getIconEndpoint, getEntity } from '~/utils'; const containerClassName = 'shadow-stroke relative flex h-full items-center justify-center rounded-full bg-white text-black'; +function getTextSizeClass(text: string | undefined | null) { + if (!text) { + return 'text-xl sm:text-2xl'; + } + + if (text.length < 40) { + return 'text-2xl sm:text-4xl'; + } + + if (text.length < 70) { + return 'text-xl sm:text-2xl'; + } + + return 'text-lg sm:text-md'; +} + export default function Landing({ centerFormOnLanding }: { centerFormOnLanding: boolean }) { const { conversation } = useChatContext(); const agentsMap = useAgentsMapContext(); @@ -122,6 +138,11 @@ export default function Landing({ centerFormOnLanding }: { centerFormOnLanding: return margin; }, [lineCount, description, textHasMultipleLines, contentHeight]); + const greetingText = + typeof startupConfig?.interface?.customWelcome === 'string' + ? getGreeting() + : getGreeting() + (user?.name ? ', ' + user.name : ''); + return (