"use client";
import { useState } from "react";
import { CardAnnonce } from "@/lib/components/annonceComponents/annonceCardComponent";
import Link from "next/link";
import { AnnonceProps } from "@/lib/types/AnnonceProps";
import type { Prisma, Question } from "@prisma/client";
type Data = {
annonces: AnnonceProps[];
questions: Question[];
answers: any[];
};
export default function ProfileTabsClient({
data,
userRole,
isOwner,
}: {
data: Data;
userRole: string;
isOwner: boolean;
}) {
const [tab, setTab] = useState<"annonces" | "questions" | "answers">("annonces");
return (
Aucune annonce.
Publié le {new Date(q.createdAt).toLocaleDateString("fr-FR")}
Répondu le {new Date(q.createdAt).toLocaleDateString("fr-FR")}
{data.questions.map((q: Question) => (
))}
{tab === "answers" &&
(data.answers.length === 0 ? (
{data.answers.map((q: any) => (
))}
{label}
{cta && ( {cta.text} )}