import React, {ChangeEvent} from 'react'; import {Trash2} from 'lucide-react'; import {ActChapter} from '@/lib/types/chapter'; import InputField from '@/components/form/InputField'; import TextAreaInput from '@/components/form/TextAreaInput'; import {useTranslations} from '@/lib/i18n'; interface ActChapterItemProps { chapter: ActChapter; onUpdateSummary: (chapterId: string, summary: string) => void; onUnlink: (chapterInfoId: string, chapterId: string) => Promise; } export default function ActChapterItem({chapter, onUpdateSummary, onUnlink}: ActChapterItemProps) { const t = useTranslations('actComponent'); return (
) => onUpdateSummary(chapter.chapterId, e.target.value) } placeholder={t('chapterSummaryPlaceholder')} /> } actionIcon={Trash2} fieldName={chapter.title} action={(): Promise => onUnlink(chapter.chapterInfoId, chapter.chapterId)} actionLabel={t('remove')} />
); }