Files
radicle-explorer/httpd-client/lib/project/comment.ts
T
Sebastian Martinez 448c762831 Show edited label on edited comments and issues
If a comment or an issue had at least one additional edit, we show a `edited` label,
which on hover shows the standard tooltip with more information on
who edited it and when.
2023-12-15 07:10:14 +01:00

24 lines
744 B
TypeScript

import type { z } from "zod";
import { array, number, object, string, tuple } from "zod";
export type Comment = z.infer<typeof commentSchema>;
export type Embed = z.infer<typeof commentSchema>["embeds"][0];
export const commentSchema = object({
id: string(),
author: object({ id: string(), alias: string().optional() }),
body: string(),
edits: array(
object({
author: object({ id: string(), alias: string().optional() }),
body: string(),
embeds: array(object({ name: string(), content: string() })),
timestamp: number(),
}),
),
embeds: array(object({ name: string(), content: string() })),
reactions: array(tuple([string(), string()])),
timestamp: number(),
replyTo: string().nullable(),
});