hensei-web/components/toasts/RemixedToast/index.tsx
Justin Edmund b94ff33d04
Add updates from 2023/06 Flash Gala (#331)
* Fix server unavailable message

Booleans are hard

* Remove a log

* Add characters from 2023-06 Flash Gala
2023-06-22 02:05:52 -07:00

47 lines
978 B
TypeScript

import React, { useEffect } from 'react'
import Toast from '~components/common/Toast'
import { Trans, useTranslation } from 'next-i18next'
interface Props {
partyName: string
open: boolean
onActionClick?: () => void
onOpenChange: (open: boolean) => void
onCloseClick: () => void
}
const RemixedToast = ({
partyName,
open,
onOpenChange,
onCloseClick,
}: Props) => {
const { t } = useTranslation('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={
<Trans i18nKey="toasts.remixed">
You remixed <strong>{{ title: partyName }}</strong>
</Trans>
}
onOpenChange={handleOpenChange}
onCloseClick={handleCloseClick}
/>
)
}
export default RemixedToast