mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-11-16 17:34:23 +08:00
refactor(frontend): extract reusable hooks and page helper modules
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
export const getConnectionStatusMeta = (
|
||||
status: "online" | "offline",
|
||||
): { color: "success" | "danger"; text: string } => {
|
||||
if (status === "online") {
|
||||
return { color: "success", text: "在线" };
|
||||
}
|
||||
|
||||
return { color: "danger", text: "离线" };
|
||||
};
|
||||
|
||||
export const getRemoteSyncErrorMessage = (syncError: string): string => {
|
||||
if (syncError === "provider_share_deleted") {
|
||||
return "提供方已删除该分享";
|
||||
}
|
||||
|
||||
if (syncError === "provider_share_disabled") {
|
||||
return "提供方已禁用该分享";
|
||||
}
|
||||
|
||||
if (syncError === "provider_share_expired") {
|
||||
return "提供方分享已过期";
|
||||
}
|
||||
|
||||
return `远程同步失败: ${syncError}`;
|
||||
};
|
||||
Reference in New Issue
Block a user