Adds treasures
This commit is contained in:
@@ -2,7 +2,14 @@
|
||||
// Generic row component for displaying any document type.
|
||||
import { SessionRow } from "@/components/documents/session/SessionRow";
|
||||
import { SecretRow } from "@/components/documents/secret/SecretRow";
|
||||
import { isSecret, isSession, type Document, type Session } from "@/lib/types";
|
||||
import {
|
||||
isSecret,
|
||||
isSession,
|
||||
isTreasure,
|
||||
type Document,
|
||||
type Session,
|
||||
} from "@/lib/types";
|
||||
import { TreasureRow } from "./treasure/TreasureRow";
|
||||
|
||||
/**
|
||||
* Renders a row for any document type. Prioritizes Session, then Secret, then falls back to ID and creation time.
|
||||
@@ -22,6 +29,10 @@ export const DocumentRow = ({
|
||||
if (isSecret(document)) {
|
||||
return <SecretRow secret={document} session={session} />;
|
||||
}
|
||||
if (isTreasure(document)) {
|
||||
return <TreasureRow treasure={document} session={session} />;
|
||||
}
|
||||
|
||||
// Fallback: show ID and creation time
|
||||
return (
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user