Merge branch 'master' of ssh://gitea.bowongai.com:222/bowong/mxivideo

This commit is contained in:
imeepos 2025-07-11 12:09:35 +08:00
commit a1d2dc0cc9
3 changed files with 14 additions and 14 deletions

View File

@ -24,7 +24,7 @@ const ProjectMaterials: React.FC<ProjectMaterialsProps> = ({
const filteredMaterials = materials.filter(material => {
// 搜索过滤
const matchesSearch = material.filename.toLowerCase().includes(searchTerm.toLowerCase()) ||
material.tags.some(tag => tag.toLowerCase().includes(searchTerm.toLowerCase()))
(material.tags || []).some(tag => tag.toLowerCase().includes(searchTerm.toLowerCase()))
// 类型过滤
let matchesType = true
@ -208,7 +208,7 @@ const ProjectMaterials: React.FC<ProjectMaterialsProps> = ({
{/* 标签 */}
<div className="flex flex-wrap gap-1 mb-3">
{material.tags.slice(0, 3).map((tag, index) => (
{(material.tags || []).slice(0, 3).map((tag, index) => (
<span
key={index}
className={`inline-flex items-center px-2 py-1 text-xs rounded-full ${
@ -221,8 +221,8 @@ const ProjectMaterials: React.FC<ProjectMaterialsProps> = ({
{tag}
</span>
))}
{material.tags.length > 3 && (
<span className="text-xs text-gray-500">+{material.tags.length - 3}</span>
{(material.tags || []).length > 3 && (
<span className="text-xs text-gray-500">+{(material.tags || []).length - 3}</span>
)}
</div>

View File

@ -107,7 +107,7 @@ const ProjectModels: React.FC<ProjectModelsProps> = ({
{ModelService.formatDuration(model.duration)} {ModelService.formatFileSize(model.file_size)}
</p>
<div className="flex flex-wrap gap-1">
{model.tags.map((tag, index) => (
{(model.tags || []).map((tag, index) => (
<span
key={index}
className="inline-block px-2 py-1 bg-blue-100 text-blue-800 text-xs rounded-full"
@ -185,9 +185,9 @@ const ProjectModels: React.FC<ProjectModelsProps> = ({
<p className="text-sm text-gray-600">
{ModelService.formatDuration(model.duration)} {ModelService.formatFileSize(model.file_size)}
</p>
{model.tags.length > 0 && (
{(model.tags || []).length > 0 && (
<div className="flex flex-wrap gap-1 mt-1">
{model.tags.slice(0, 3).map((tag, index) => (
{(model.tags || []).slice(0, 3).map((tag, index) => (
<span
key={index}
className="inline-block px-2 py-1 bg-gray-100 text-gray-700 text-xs rounded-full"
@ -195,8 +195,8 @@ const ProjectModels: React.FC<ProjectModelsProps> = ({
{tag}
</span>
))}
{model.tags.length > 3 && (
<span className="text-xs text-gray-500">+{model.tags.length - 3}</span>
{(model.tags || []).length > 3 && (
<span className="text-xs text-gray-500">+{(model.tags || []).length - 3}</span>
)}
</div>
)}

View File

@ -89,7 +89,7 @@ const ProjectTemplates: React.FC<ProjectTemplatesProps> = ({
const filteredAvailableTemplates = availableTemplates.filter(template =>
template.name.toLowerCase().includes(searchTerm.toLowerCase()) ||
template.description.toLowerCase().includes(searchTerm.toLowerCase()) ||
template.tags.some(tag => tag.toLowerCase().includes(searchTerm.toLowerCase()))
(template.tags || []).some(tag => tag.toLowerCase().includes(searchTerm.toLowerCase()))
)
const formatDuration = (seconds: number) => {
@ -181,7 +181,7 @@ const ProjectTemplates: React.FC<ProjectTemplatesProps> = ({
</div>
<div className="flex flex-wrap gap-1">
{template.tags.map((tag, index) => (
{(template.tags || []).map((tag, index) => (
<span
key={index}
className="inline-block px-2 py-1 bg-blue-100 text-blue-800 text-xs rounded-full"
@ -273,7 +273,7 @@ const ProjectTemplates: React.FC<ProjectTemplatesProps> = ({
<div className="flex items-center justify-between">
<div className="flex flex-wrap gap-1">
{template.tags.slice(0, 2).map((tag, index) => (
{(template.tags || []).slice(0, 2).map((tag, index) => (
<span
key={index}
className="inline-block px-1 py-0.5 bg-gray-100 text-gray-700 text-xs rounded"
@ -281,8 +281,8 @@ const ProjectTemplates: React.FC<ProjectTemplatesProps> = ({
{tag}
</span>
))}
{template.tags.length > 2 && (
<span className="text-xs text-gray-500">+{template.tags.length - 2}</span>
{(template.tags || []).length > 2 && (
<span className="text-xs text-gray-500">+{(template.tags || []).length - 2}</span>
)}
</div>
<button