import { useParams, Link, useNavigate } from 'react-router-dom'; import { WidePageLayout } from '../components/WidePageLayout'; import RichTextContent from '../components/RichTextContent'; import useWikiDetail from '../hooks/useWikiDetail'; const Edit2Icon = () => ( ); const Trash2Icon = () => ( ); export function WikiDetail() { const { id: boardId, wikiId } = useParams<{ id: string; wikiId: string }>(); const navigate = useNavigate(); const { wiki, deleteWiki } = useWikiDetail(wikiId || '0'); const handleDelete = async () => { if (!wiki) return; if (confirm(`Are you sure you want to delete wiki "${wiki.name}"?`)) { try { await deleteWiki(); navigate(`/boards/${boardId}/wikis`); } catch { // Error is already handled by hook with toast } } }; if (!wiki) { return (
Loading wiki...
); } return (
{/* Header */}
← Back to Wikis

{wiki.name}

{wiki.slug && /{wiki.slug}}
Edit
{/* Content */}
{/* Summary */} {wiki.summary && (

Summary

{wiki.summary}

)} {/* Rich Text Content */} {wiki.content && Array.isArray(wiki.content) && wiki.content.length > 0 && (

Content

)} {/* Tags */} {wiki.tags && wiki.tags.length > 0 && (

Tags

{wiki.tags.map((tag, index) => ( {tag} ))}
)} {/* Metadata */}

Metadata

{wiki.category && (
Category: {wiki.category}
)} {wiki.created_by && (
Created By: User #{wiki.created_by}
)} {wiki.updated_by && (
Updated By: User #{wiki.updated_by}
)}
Created: {wiki.created_at ? new Date(wiki.created_at).toLocaleString() : 'N/A'}
Updated: {wiki.updated_at ? new Date(wiki.updated_at).toLocaleString() : 'N/A'}
{/* Linked Entities Section */}

Linked Entities

🔗

This wiki can be linked to cards and other entities

); } export default WikiDetail;