import { ActionIcon } from '@lobehub/ui';
import { Space } from 'antd';
import { useResponsive } from 'antd-style';
import { Github, LucideIcon, Moon, Settings, Sun } from 'lucide-react';
import qs from 'query-string';
import { memo, useCallback, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { shallow } from 'zustand/shallow';
import { Giscus, Setting } from '@/components';
import { useAppStore } from '@/store';
const CivitaiLogo: LucideIcon | any = ({ size }: any) => (
);
interface ActionsProps {
themeMode: 'dark' | 'light';
}
const Actions = memo(() => {
const [isSettingOpen, setIsSettingOpen] = useState(false);
const [isModalOpen, setIsModalOpen] = useState(false);
const themeMode = useAppStore((st) => st.themeMode, shallow);
const { mobile } = useResponsive();
const { t } = useTranslation();
const handleSetTheme = useCallback(() => {
const theme = themeMode === 'light' ? 'dark' : 'light';
const gradioURL = qs.parseUrl(window.location.href);
gradioURL.query.__theme = theme;
window.location.replace(qs.stringifyUrl(gradioURL));
}, [themeMode]);
return (
<>
{!mobile && (
<>
setIsModalOpen(true)} title={t('feedback')} />
>
)}
setIsSettingOpen(true)} title={t('setting')} />
setIsSettingOpen(false)} open={isSettingOpen} />
setIsModalOpen(false)} open={isModalOpen} />
>
);
});
export default Actions;