mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-30 08:40:52 +08:00
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.
24 lines
744 B
TypeScript
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(),
|
|
});
|