Twenty config admin panel integration (#11755)

closes https://github.com/twentyhq/core-team-issues/issues/761
closes https://github.com/twentyhq/core-team-issues/issues/762

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
This commit is contained in:
nitin
2025-04-30 12:42:59 +05:30
committed by GitHub
parent 842367f7bb
commit e957b1acd6
73 changed files with 2958 additions and 853 deletions
@@ -0,0 +1,29 @@
import { useTheme } from '@emotion/react';
import { useLingui } from '@lingui/react/macro';
import { ConfigSource } from '~/generated/graphql';
export const useSourceContent = (source: ConfigSource) => {
const { t } = useLingui();
const theme = useTheme();
switch (source) {
case ConfigSource.DATABASE:
return {
text: t`Stored in database`,
color: theme.color.blue50,
};
case ConfigSource.ENVIRONMENT:
return {
text: t`Environment variable`,
color: theme.color.green50,
};
case ConfigSource.DEFAULT:
return {
text: t`Default value`,
color: theme.font.color.tertiary,
};
default:
throw new Error(`Unknown source: ${source}`);
}
};