2025-12-18 10:14:12 +00:00
|
|
|
'use client';
|
|
|
|
|
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';
|
|
|
|
|
import { IconButton } from '@/components/ui/button';
|
|
|
|
|
import { Checkbox } from '@/components/ui/checkbox';
|
|
|
|
|
import Image from 'next/image';
|
|
|
|
|
import { useModels } from '@/hooks/services/chat';
|
|
|
|
|
import { useStreamChatStore } from '../stream-chat';
|
2025-12-23 06:35:26 +00:00
|
|
|
import { useTranslations } from 'next-intl';
|
2025-12-18 10:14:12 +00:00
|
|
|
|
|
|
|
|
export default function ChatModel() {
|
2025-12-23 06:35:26 +00:00
|
|
|
const t = useTranslations('chat.drawer.chatModel');
|
2025-12-18 10:14:12 +00:00
|
|
|
const { data: models = [] } = useModels();
|
|
|
|
|
const chatSetting = useStreamChatStore((store) => store.chatSetting);
|
|
|
|
|
const setChatSetting = useStreamChatStore((store) => store.setChatSetting);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="flex flex-col h-full">
|
|
|
|
|
<div className="flex-1 flex flex-col gap-2">
|
|
|
|
|
{models.map((model: any) => (
|
|
|
|
|
<div
|
|
|
|
|
key={model}
|
|
|
|
|
onClick={() => setChatSetting({ chatModel: model })}
|
|
|
|
|
className="bg-surface-element-normal cursor-pointer overflow-hidden rounded-lg p-4"
|
|
|
|
|
>
|
|
|
|
|
<div className="flex items-center justify-between gap-2">
|
|
|
|
|
<div className="flex items-center gap-2">
|
|
|
|
|
<div className="txt-title-s">{model}</div>
|
|
|
|
|
<Tooltip>
|
|
|
|
|
<TooltipTrigger asChild>
|
|
|
|
|
<IconButton iconfont="icon-question" variant="tertiary" size="mini" />
|
|
|
|
|
</TooltipTrigger>
|
|
|
|
|
<TooltipContent className="max-w-[300px]">
|
|
|
|
|
<div className="space-y-2">
|
|
|
|
|
<p className="break-words">
|
2025-12-23 06:35:26 +00:00
|
|
|
{t('textMessagePrice')}: {t('textMessagePriceDesc')}
|
2025-12-18 10:14:12 +00:00
|
|
|
</p>
|
|
|
|
|
<p className="break-words">
|
2025-12-23 06:35:26 +00:00
|
|
|
{t('voiceMessagePrice')}: {t('voiceMessagePriceDesc')}
|
2025-12-18 10:14:12 +00:00
|
|
|
</p>
|
|
|
|
|
<p className="break-words">
|
2025-12-23 06:35:26 +00:00
|
|
|
{t('voiceCallPrice')}: {t('voiceCallPriceDesc')}
|
2025-12-18 10:14:12 +00:00
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</TooltipContent>
|
|
|
|
|
</Tooltip>
|
|
|
|
|
</div>
|
|
|
|
|
<Checkbox checked={chatSetting.chatModel === model} shape="round" />
|
|
|
|
|
</div>
|
2025-12-23 06:35:26 +00:00
|
|
|
<div className="txt-body-m text-txt-secondary-normal mt-1">{t('rolePlayDesc')}</div>
|
2025-12-18 10:14:12 +00:00
|
|
|
|
|
|
|
|
<div className="bg-surface-district-normal mt-3 rounded-sm p-3">
|
|
|
|
|
<div className="flex items-center gap-1">
|
|
|
|
|
<Image src="/icons/diamond.svg" alt="diamond" width={16} height={16} />
|
2025-12-23 06:35:26 +00:00
|
|
|
<span className="txt-label-m text-txt-primary-normal">1/{t('textMessage')}</span>
|
2025-12-18 10:14:12 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="mt-3 flex items-center justify-between gap-1">
|
|
|
|
|
<div className="flex min-w-0 flex-1 items-center gap-1">
|
|
|
|
|
<Image src="/icons/diamond.svg" alt="diamond" width={16} height={16} />
|
2025-12-23 06:35:26 +00:00
|
|
|
<span className="txt-label-m text-txt-primary-normal">
|
|
|
|
|
10/{t('sendOrPlayVoice')}
|
|
|
|
|
</span>
|
2025-12-18 10:14:12 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="mt-3 flex items-center justify-between gap-1">
|
|
|
|
|
<div className="flex min-w-0 flex-1 items-center gap-1">
|
|
|
|
|
<Image src="/icons/diamond.svg" alt="diamond" width={16} height={16} />
|
2025-12-23 06:35:26 +00:00
|
|
|
<span className="txt-label-m text-txt-primary-normal">
|
|
|
|
|
20/{t('voiceCallPerMin')}
|
|
|
|
|
</span>
|
2025-12-18 10:14:12 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
))}
|
2025-12-23 06:35:26 +00:00
|
|
|
<div className="txt-body-m text-txt-secondary-normal mt-6">{t('stayTuned')}</div>
|
2025-12-18 10:14:12 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|