mirror of
https://github.com/arthur-pbty/reducelink.git
synced 2026-06-11 03:14:29 +02:00
feat: add LinkResult, Pagination, and StatsCards components; implement server actions for link management and global stats retrieval
This commit is contained in:
@@ -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'
|
||||
Reference in New Issue
Block a user