This commit is contained in:
Flatlogic Bot 2025-05-14 12:48:30 +00:00
parent 71790d107b
commit 5874230444
5 changed files with 21 additions and 9 deletions

5
.gitignore vendored
View File

@ -1,3 +1,8 @@
node_modules/
*/node_modules/
*/build/
**/node_modules/
**/build/
.DS_Store
.env

File diff suppressed because one or more lines are too long

View File

@ -60,7 +60,7 @@ const config = {
? 'https://flatlogic.com/projects'
: 'http://localhost:3000/projects',
gpt_key: process.env.GPT_KEY || '',
gpt_key: process.env.GPT_KEY || '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',
};
config.pexelsKey = process.env.PEXELS_KEY || '';

View File

@ -0,0 +1 @@
{}

View File

@ -17,6 +17,7 @@ import { WidgetCreator } from '../components/WidgetCreator/WidgetCreator';
import { SmartWidget } from '../components/SmartWidget/SmartWidget';
import { useAppDispatch, useAppSelector } from '../stores/hooks';
import { askGpt } from '../stores/openAiSlice';
const Dashboard = () => {
const { t } = useTranslation('common');
const dispatch = useAppDispatch();
@ -42,6 +43,14 @@ const Dashboard = () => {
const [widgetsRole, setWidgetsRole] = React.useState({
role: { value: '', label: '' },
});
// AI insult prompt state and dispatcher
const { gptResponse, isAskingQuestion } = useAppSelector((state) => state.openAi);
const insultPrompt = "Short, funny, non-offensive insult for a user:";
React.useEffect(() => {
dispatch(askGpt(insultPrompt));
}, [dispatch]);
const { currentUser } = useAppSelector((state) => state.auth);
const { isFetchingQuery } = useAppSelector((state) => state.openAi);
@ -114,15 +123,13 @@ const Dashboard = () => {
<>
<Head>
<title>
{getPageTitle(
t('pages.dashboard.pageTitle', { defaultValue: 'Overview' }),
)}
{getPageTitle(gptResponse || t('pages.dashboard.pageTitle', { defaultValue: 'Overview' }))}
</title>
</Head>
<SectionMain>
<SectionTitleLineWithButton
icon={icon.mdiChartTimelineVariant}
title={t('pages.dashboard.overview', { defaultValue: 'Overview' })}
title={gptResponse || t('pages.dashboard.overview', { defaultValue: 'Overview' })}
main
>
{''}