import { PlusOutlined } from '@ant-design/icons';
import { defaultTheme, useGlobalTheme, useToken } from '@nocobase/client';
import { App, Button, Space } from 'antd';
import React, { useCallback } from 'react';
import { useTranslation } from '../locale';
import compatOldTheme from '../utils/compatOldTheme';
import { useThemeEditorContext } from './ThemeEditorProvider';
const ToEditTheme = () => {
const { theme, setTheme, setCurrentSettingTheme } = useGlobalTheme();
const { token } = useToken();
const { setOpen } = useThemeEditorContext();
const { t } = useTranslation();
const { modal } = App.useApp();
const handleClick = useCallback(() => {
const m = modal.confirm({
title: t('Add new theme'),
closable: true,
maskClosable: true,
width: 'fit-content',
footer: (
),
});
}, [modal, setCurrentSettingTheme, setOpen, setTheme, t, theme, token.margin]);
return (
}
onClick={handleClick}
>
{t('Add new theme')}
);
};
ToEditTheme.displayName = 'ToEditTheme';
export default ToEditTheme;