dify/web/app/components/share/text-generation/info-modal.tsx
Coding On Star 8581a68174
refactor(web): drop headless-ui, migrate overlay to dify-ui (#35963)
Co-authored-by: CodingOnStar <hanxujiang@dify.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: yyh <yuanyouhuilyz@gmail.com>
Co-authored-by: yyh <92089059+lyzno1@users.noreply.github.com>
2026-05-09 10:33:25 +00:00

60 lines
1.7 KiB
TypeScript

import type { SiteInfo } from '@/models/share'
import { cn } from '@langgenius/dify-ui/cn'
import { Dialog, DialogCloseButton, DialogContent } from '@langgenius/dify-ui/dialog'
import * as React from 'react'
import AppIcon from '@/app/components/base/app-icon'
import { appDefaultIconBackground } from '@/config'
type Props = {
data?: SiteInfo
isShow: boolean
onClose: () => void
}
const InfoModal = ({
isShow,
onClose,
data,
}: Props) => {
return (
<Dialog
open={isShow}
onOpenChange={(open) => {
if (!open)
onClose()
}}
>
<DialogContent className="w-full max-w-[400px] min-w-[400px] overflow-hidden! border-none p-0! text-left align-middle">
<DialogCloseButton data-testid="modal-close-button" />
<div className={cn('flex flex-col items-center gap-4 px-4 pt-10 pb-8')}>
<AppIcon
size="xxl"
iconType={data?.icon_type}
icon={data?.icon}
background={data?.icon_background || appDefaultIconBackground}
imageUrl={data?.icon_url}
/>
<div className="system-xl-semibold text-text-secondary">{data?.title}</div>
<div className="system-xs-regular text-text-tertiary">
{/* copyright */}
{data?.copyright && (
<div>
©
{(new Date()).getFullYear()}
{' '}
{data?.copyright}
</div>
)}
{data?.custom_disclaimer && (
<div className="mt-2">{data.custom_disclaimer}</div>
)}
</div>
</div>
</DialogContent>
</Dialog>
)
}
export default InfoModal