♻️ Refactored attachment page

This commit is contained in:
2025-11-06 01:33:49 +08:00
parent 6da1a4d21c
commit 9f82214797
8 changed files with 264 additions and 151 deletions

View File

@@ -1,5 +1,5 @@
// Re-export all types from separate files for easy importing
export type { SnFileMeta, SnAttachment, SnPost } from './post'
export type { SnFileMeta, SnCloudFile as SnAttachment, SnPost } from './post'
export type { SnVerification, SnPublisher } from './publisher'
export type { SnActivity } from './activity'
export type { SnWalletOrder, OrderStatus } from './order'

View File

@@ -23,7 +23,7 @@ export interface SnFileMeta {
}
// Attachment interface
export interface SnAttachment {
export interface SnCloudFile {
id: string;
name: string;
fileMeta: SnFileMeta;
@@ -33,6 +33,7 @@ export interface SnAttachment {
hash: string;
size: number;
hasCompression: boolean;
isEncrypted: boolean;
createdAt: string;
updatedAt: string;
deletedAt: string | null;
@@ -69,7 +70,7 @@ export interface SnPost {
forwardedPost: SnPost | null;
realmId: string | null;
realm: unknown | null;
attachments: SnAttachment[];
attachments: SnCloudFile[];
publisherId: string;
publisher: SnPublisher;
awards: unknown | null;

View File

@@ -1,4 +1,4 @@
import type { SnAttachment } from './post'
import type { SnCloudFile } from './post'
// Verification interface
export interface SnVerification {
@@ -17,8 +17,8 @@ export interface SnPublisher {
bio: string;
pictureId: string;
backgroundId: string;
picture: SnAttachment | null;
background: SnAttachment | null;
picture: SnCloudFile | null;
background: SnCloudFile | null;
verification: SnVerification | null;
accountId: string;
realmId: string | null;

View File

@@ -1,4 +1,4 @@
import type { SnAttachment } from './post'
import type { SnCloudFile } from './post'
import type { SnVerification } from './publisher'
// Account link interface
@@ -63,8 +63,8 @@ export interface SnAccountProfile {
socialCredits: number;
socialCreditsLevel: number;
levelingProgress: number;
picture: SnAttachment | null;
background: SnAttachment | null;
picture: SnCloudFile | null;
background: SnCloudFile | null;
accountId: string;
resourceIdentifier: string;
createdAt: string;