Merge branch 'master' of ssh://gitea.bowongai.com:222/bowong/mxivideo
This commit is contained in:
commit
a1d2dc0cc9
|
|
@ -24,7 +24,7 @@ const ProjectMaterials: React.FC<ProjectMaterialsProps> = ({
|
||||||
const filteredMaterials = materials.filter(material => {
|
const filteredMaterials = materials.filter(material => {
|
||||||
// 搜索过滤
|
// 搜索过滤
|
||||||
const matchesSearch = material.filename.toLowerCase().includes(searchTerm.toLowerCase()) ||
|
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
|
let matchesType = true
|
||||||
|
|
@ -208,7 +208,7 @@ const ProjectMaterials: React.FC<ProjectMaterialsProps> = ({
|
||||||
|
|
||||||
{/* 标签 */}
|
{/* 标签 */}
|
||||||
<div className="flex flex-wrap gap-1 mb-3">
|
<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
|
<span
|
||||||
key={index}
|
key={index}
|
||||||
className={`inline-flex items-center px-2 py-1 text-xs rounded-full ${
|
className={`inline-flex items-center px-2 py-1 text-xs rounded-full ${
|
||||||
|
|
@ -221,8 +221,8 @@ const ProjectMaterials: React.FC<ProjectMaterialsProps> = ({
|
||||||
{tag}
|
{tag}
|
||||||
</span>
|
</span>
|
||||||
))}
|
))}
|
||||||
{material.tags.length > 3 && (
|
{(material.tags || []).length > 3 && (
|
||||||
<span className="text-xs text-gray-500">+{material.tags.length - 3}</span>
|
<span className="text-xs text-gray-500">+{(material.tags || []).length - 3}</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ const ProjectModels: React.FC<ProjectModelsProps> = ({
|
||||||
{ModelService.formatDuration(model.duration)} • {ModelService.formatFileSize(model.file_size)}
|
{ModelService.formatDuration(model.duration)} • {ModelService.formatFileSize(model.file_size)}
|
||||||
</p>
|
</p>
|
||||||
<div className="flex flex-wrap gap-1">
|
<div className="flex flex-wrap gap-1">
|
||||||
{model.tags.map((tag, index) => (
|
{(model.tags || []).map((tag, index) => (
|
||||||
<span
|
<span
|
||||||
key={index}
|
key={index}
|
||||||
className="inline-block px-2 py-1 bg-blue-100 text-blue-800 text-xs rounded-full"
|
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">
|
<p className="text-sm text-gray-600">
|
||||||
{ModelService.formatDuration(model.duration)} • {ModelService.formatFileSize(model.file_size)}
|
{ModelService.formatDuration(model.duration)} • {ModelService.formatFileSize(model.file_size)}
|
||||||
</p>
|
</p>
|
||||||
{model.tags.length > 0 && (
|
{(model.tags || []).length > 0 && (
|
||||||
<div className="flex flex-wrap gap-1 mt-1">
|
<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
|
<span
|
||||||
key={index}
|
key={index}
|
||||||
className="inline-block px-2 py-1 bg-gray-100 text-gray-700 text-xs rounded-full"
|
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}
|
{tag}
|
||||||
</span>
|
</span>
|
||||||
))}
|
))}
|
||||||
{model.tags.length > 3 && (
|
{(model.tags || []).length > 3 && (
|
||||||
<span className="text-xs text-gray-500">+{model.tags.length - 3}</span>
|
<span className="text-xs text-gray-500">+{(model.tags || []).length - 3}</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ const ProjectTemplates: React.FC<ProjectTemplatesProps> = ({
|
||||||
const filteredAvailableTemplates = availableTemplates.filter(template =>
|
const filteredAvailableTemplates = availableTemplates.filter(template =>
|
||||||
template.name.toLowerCase().includes(searchTerm.toLowerCase()) ||
|
template.name.toLowerCase().includes(searchTerm.toLowerCase()) ||
|
||||||
template.description.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) => {
|
const formatDuration = (seconds: number) => {
|
||||||
|
|
@ -181,7 +181,7 @@ const ProjectTemplates: React.FC<ProjectTemplatesProps> = ({
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex flex-wrap gap-1">
|
<div className="flex flex-wrap gap-1">
|
||||||
{template.tags.map((tag, index) => (
|
{(template.tags || []).map((tag, index) => (
|
||||||
<span
|
<span
|
||||||
key={index}
|
key={index}
|
||||||
className="inline-block px-2 py-1 bg-blue-100 text-blue-800 text-xs rounded-full"
|
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 items-center justify-between">
|
||||||
<div className="flex flex-wrap gap-1">
|
<div className="flex flex-wrap gap-1">
|
||||||
{template.tags.slice(0, 2).map((tag, index) => (
|
{(template.tags || []).slice(0, 2).map((tag, index) => (
|
||||||
<span
|
<span
|
||||||
key={index}
|
key={index}
|
||||||
className="inline-block px-1 py-0.5 bg-gray-100 text-gray-700 text-xs rounded"
|
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}
|
{tag}
|
||||||
</span>
|
</span>
|
||||||
))}
|
))}
|
||||||
{template.tags.length > 2 && (
|
{(template.tags || []).length > 2 && (
|
||||||
<span className="text-xs text-gray-500">+{template.tags.length - 2}</span>
|
<span className="text-xs text-gray-500">+{(template.tags || []).length - 2}</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue