WIP: Linking in document list. Working on copying relationships to new sessions
This commit is contained in:
26
src/components/documents/BasicRow.tsx
Normal file
26
src/components/documents/BasicRow.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import type { AnyDocument } from "@/lib/types";
|
||||
import { Link } from "@tanstack/react-router";
|
||||
|
||||
export type Props = {
|
||||
doc: AnyDocument;
|
||||
title: string;
|
||||
description?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Renders a simple row that links to the document
|
||||
*/
|
||||
export const BasicRow = ({ doc, title, description }: Props) => {
|
||||
return (
|
||||
<li>
|
||||
<Link
|
||||
to="/document/$documentId"
|
||||
params={{ documentId: doc.id }}
|
||||
className="text-lg"
|
||||
>
|
||||
<h4>{title}</h4>
|
||||
</Link>
|
||||
{description && <p>{description}</p>}
|
||||
</li>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user