refactor: reorganize project structure and improve type definitions

- Split types into separate modules for better organization
- Move data files to dedicated directories with proper documentation
- Enhance i18n utilities with better type safety and performance
- Maintain backward compatibility with legacy imports
This commit is contained in:
joyzhao
2025-06-21 09:18:39 +08:00
parent e38ec6b12f
commit ea01dc6dd8
14 changed files with 784 additions and 523 deletions

76
src/lib/data/services.ts Normal file
View File

@@ -0,0 +1,76 @@
/**
* Services data module
* Contains all service information displayed in the services section
*/
import type { Service } from '@/types';
/**
* Services data with localization support
* Each service contains information like title, icon, items, and color
*/
export const services = {
en: [
{
title: "Outsourcing Projects",
icon: {
svg: `<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 13.255A23.931 23.931 0 0112 15c-3.183 0-6.22-.62-9-1.745M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v2m4 6h.01M5 20h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"></path>`,
gradient: "from-blue-500 to-cyan-500",
},
items: [
"Provide outsourcing project services for overseas clients",
"Project packaging, can provide services in different packages",
"Use popular technologies: React, nest.js, next.js, etc.",
"Project delivery, provide three months of free maintenance",
"Regardless of project size, can provide services",
],
color: "blue",
},
{
title: "Bug Fixes",
icon: {
svg: `<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"></path><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path>`,
gradient: "from-red-500 to-pink-500",
},
items: [
"Quickly locate and fix website issues, able to quickly locate and solve problems",
"Help you solve any problems encountered in the project, Bug, functional optimization issues",
"Application of Vue, React, Node and other technologies",
"Frontend automation, deployment, monitoring, automation, etc.",
"Only limited to Node.js projects",
],
color: "red",
},
],
zh: [
{
title: "外包项目",
icon: {
svg: `<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 13.255A23.931 23.931 0 0112 15c-3.183 0-6.22-.62-9-1.745M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v2m4 6h.01M5 20h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"></path>`,
gradient: "from-blue-500 to-cyan-500",
},
items: [
"为海外客户提供外包项目服务",
"项目打包,可以提供不同套餐的服务",
"使用流行技术React、nest.js、next.js 等",
"项目交付,提供三个月免费维护",
"不论项目大小,都可以提供服务",
],
color: "blue",
},
{
title: "Bug 修复",
icon: {
svg: `<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"></path><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path>`,
gradient: "from-red-500 to-pink-500",
},
items: [
"快速定位和修复网站问题,能够快速定位和解决问题",
"帮助您解决项目中遇到的任何问题Bug、功能优化问题",
"Vue、React、Node 等技术的应用",
"前端自动化、部署、监控、自动化等",
"仅限于 Node.js 项目",
],
color: "red",
},
],
};