import { Edit, Trash2 } from "lucide-react"; import { TextPair } from "./InFolder"; import { updateTextPairById } from "@/lib/services/textPairService"; import { useState } from "react"; import { text_pairUpdateInput } from "../../../../generated/prisma/models"; import UpdateTextPairModal from "./UpdateTextPairModal"; import { useTranslations } from "next-intl"; interface TextPairCardProps { textPair: TextPair; onDel: () => void; refreshTextPairs: () => void; } export default function TextPairCard({ textPair, onDel, refreshTextPairs, }: TextPairCardProps) { const [openUpdateModal, setOpenUpdateModal] = useState(false); const t = useTranslations("folder_id"); return (
{textPair.locale1.toUpperCase()} {textPair.locale2.toUpperCase()}
{textPair.text1}
{textPair.text2}
setOpenUpdateModal(false)} onUpdate={async (id: number, data: text_pairUpdateInput) => { await updateTextPairById(id, data); setOpenUpdateModal(false); refreshTextPairs(); }} textPair={textPair} />
); }