memos/web/src/components/MemoView/constants.ts
Johnny 1ef11f7470 refactor: implement MemoView component with subcomponents and hooks
- Added MemoView component to display a single memo card with full functionality including creator info, memo content, attachments, reactions, and comments.
- Created MemoBody and MemoHeader subcomponents to separate concerns and improve maintainability.
- Introduced custom hooks for managing memo actions, keyboard shortcuts, NSFW content visibility, and image preview.
- Implemented reaction handling with new ReactionSelector and ReactionView components.
- Added TypeScript types for better type safety and clarity.
- Established constants for memo card styling and keyboard shortcuts.
- Removed legacy ReactionSelector and ReactionView components from the previous structure.
2025-11-29 23:21:35 +08:00

19 lines
706 B
TypeScript

/**
* Constants for MemoView component
*/
/** CSS class for memo card styling */
export const MEMO_CARD_BASE_CLASSES =
"relative group flex flex-col justify-start items-start bg-card w-full px-4 py-3 mb-2 gap-2 text-card-foreground rounded-lg border border-border transition-colors";
/** Keyboard shortcut keys */
export const KEYBOARD_SHORTCUTS = {
EDIT: "e",
ARCHIVE: "a",
} as const;
/** Text input element types for keyboard shortcut filtering */
export const TEXT_INPUT_TYPES = ["text", "search", "email", "password", "url", "tel", "number"] as const;
/** Time threshold for relative time format (24 hours in milliseconds) */
export const RELATIVE_TIME_THRESHOLD_MS = 1000 * 60 * 60 * 24;