feat: add LinkResult, Pagination, and StatsCards components; implement server actions for link management and global stats retrieval

This commit is contained in:
Puechberty Arthur
2026-03-30 19:28:58 +02:00
parent 4ede5021b1
commit f95587fc7a
46 changed files with 4224 additions and 177 deletions
+51
View File
@@ -0,0 +1,51 @@
// Types TypeScript pour ReduceLink
export interface Link {
id: number
originalUrl: string
shortCode: string
clickCount: number
createdAt: Date
title?: string | null
favicon?: string | null
}
export interface CreateLinkRequest {
url: string
customAlias?: string
}
export interface CreateLinkResponse {
success: boolean
link?: Link
shortUrl?: string
isReused?: boolean
error?: string
}
export interface GlobalStats {
totalLinks: number
totalClicks: number
linksToday: number
clicksToday: number
}
export interface LinkPreview {
url: string
domain: string
favicon: string
title?: string
isValid: boolean
isSuspicious: boolean
suspiciousReason?: string
}
export interface PaginatedLinks {
links: Link[]
total: number
page: number
pageSize: number
totalPages: number
}
export type SortOption = 'recent' | 'popular' | 'alphabetical'