This commit is contained in:
suvodip ghosh
2025-04-21 13:40:26 +00:00
parent 7258809230
commit 10a2c0c2c3
22 changed files with 11496 additions and 790 deletions

View File

@@ -1,19 +1,20 @@
import React from "react";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "./ui/card";
import { marked } from 'marked';
export default function TopicDetail(props) {
console.log('All topic Form allTopic', props.allTopic)
// console.log('All topic Form allTopic', props.allTopic);
if (!props.topic) {
return <div>Topic not found</div>;
}
return (
<div className="container mx-auto px-4 py-12">
<article className="max-w-4xl mx-auto">
<img src={props.topic.img} alt={props.topic.title} className="w-full h-96 object-cover rounded-lg mb-8" />
<h1 className="text-4xl font-bold text-[#6d9e37] mb-4">{props.topic.title}</h1>
<p className="font-light mb-8 text-justify" dangerouslySetInnerHTML={{__html: props.topic.content}}></p>
</article>
<article className="max-w-4xl mx-auto">
<img src={props.topic.img} alt={props.topic.title} className="w-full h-96 object-cover rounded-lg mb-8" />
<h1 className="text-4xl font-bold text-[#6d9e37] mb-4">{props.topic.title}</h1>
<div className="font-light mb-8 text-justify prose max-w-none" dangerouslySetInnerHTML={{ __html: marked.parse(props.topic.content || '') }}></div>
</article>
</div>
);
}
}