hensei-web/components/toasts/RemixedToast/index.tsx
Justin Edmund b34cc8a4eb refactor: migrate all components from next-i18next to next-intl
- Update all component imports from useTranslation to useTranslations
- Replace react-i18next and next-i18next imports with next-intl
- Convert Trans components to t.rich() for rich text formatting
- Update all translation hook usage to next-intl API

This affects 80+ component files across the codebase including:
- Character, weapon, summon components
- Auth modals (login, signup, account)
- Party management components
- Filter and search components
- Toast notifications
- About pages and content updates

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-02 19:48:04 -07:00

50 lines
1,009 B
TypeScript

import React, { useEffect } from 'react'
import Toast from '~components/common/Toast'
import { useTranslations } from 'next-intl'
interface Props {
partyName: string
open: boolean
onActionClick?: () => void
onOpenChange: (open: boolean) => void
onCloseClick: () => void
}
const RemixedToast = ({
partyName,
open,
onOpenChange,
onCloseClick,
}: Props) => {
const t = useTranslations('common')
// Methods: Event handlers
function handleOpenChange() {
onOpenChange(open)
}
function handleCloseClick() {
onCloseClick()
}
return (
<Toast
altText={t('toasts.remixed', { title: partyName })}
open={open}
duration={2400}
type="foreground"
content={
<>
{t.rich('toasts.remixed', {
title: partyName,
strong: (chunks) => <strong>{chunks}</strong>
})}
</>
}
onOpenChange={handleOpenChange}
onCloseClick={handleCloseClick}
/>
)
}
export default RemixedToast