import { useTranslation } from 'react-i18next'
import Button from '@/app/components/base/button'
import Divider from '@/app/components/base/divider'
import Switch from '@/app/components/base/switch'
import { cn } from '@/utils/classnames'
import ChatPreviewCard from './components/chat-preview-card'
import WorkflowPreviewCard from './components/workflow-preview-card'
import useWebAppBrand from './hooks/use-web-app-brand'
const ALLOW_FILE_EXTENSIONS = ['svg', 'png']
const CustomWebAppBrand = () => {
const { t } = useTranslation()
const {
fileId,
imgKey,
uploadProgress,
uploading,
webappLogo,
webappBrandRemoved,
uploadDisabled,
workspaceLogo,
isCurrentWorkspaceManager,
isSandbox,
handleApply,
handleCancel,
handleChange,
handleRestore,
handleSwitch,
} = useWebAppBrand()
return (
{t('webapp.removeBrand', { ns: 'custom' })}
{t('webapp.changeLogo', { ns: 'custom' })}
{t('webapp.changeLogoTip', { ns: 'custom' })}
{(!uploadDisabled && webappLogo && !webappBrandRemoved) && (
<>
>
)}
{
!uploading && (
)
}
{
uploading && (
)
}
{
fileId && (
<>
>
)
}
{uploadProgress === -1 && (
{t('uploadedFail', { ns: 'custom' })}
)}
{t('overview.appInfo.preview', { ns: 'appOverview' })}
)
}
export default CustomWebAppBrand