refactor: repartition server-side and client-side code

This commit is contained in:
LIlGG
2025-10-11 18:26:07 +08:00
parent 7acc4949fb
commit e9b573a276
309 changed files with 631 additions and 962 deletions

View File

@@ -0,0 +1,18 @@
import type { Deployment } from '@prisma/client';
import { useLoaderData } from '@remix-run/react';
import type { DeploymentPlatform } from '~/types/deployment';
/**
* 仅支持 Chat 路由中的部署记录
*/
export function useChatDeployment() {
const { deployments } = useLoaderData<{ deployments?: Deployment[] }>();
const getDeploymentByPlatform = (platform: DeploymentPlatform) => {
return deployments?.find((deployment) => deployment.platform === platform);
};
return {
getDeploymentByPlatform,
};
}