mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-03 04:38:33 +00:00
fix(studio): fix catalog Add button per category, search by tags
Add button rules: VFX, Social, Scenes get Add + Ask agent. Captions, Transitions, Effects, Data get Ask agent only. Search now matches category names and tags, so searching "captions" shows all caption blocks.
This commit is contained in:
@@ -119,7 +119,9 @@ export const BlocksTab = memo(function BlocksTab({ onAddBlock, onPreviewBlock }:
|
||||
videoUrl={block.preview?.video}
|
||||
onPreview={onPreviewBlock}
|
||||
onAdd={
|
||||
block.type === "hyperframes:component"
|
||||
block.category === "vfx" ||
|
||||
block.category === "social" ||
|
||||
block.category === "scenes"
|
||||
? () => onAddBlock?.(block.name)
|
||||
: undefined
|
||||
}
|
||||
|
||||
@@ -56,7 +56,11 @@ export function useBlockCatalog() {
|
||||
if (search.trim()) {
|
||||
const q = search.toLowerCase();
|
||||
result = result.filter(
|
||||
(b) => b.title.toLowerCase().includes(q) || b.description.toLowerCase().includes(q),
|
||||
(b) =>
|
||||
b.title.toLowerCase().includes(q) ||
|
||||
b.description.toLowerCase().includes(q) ||
|
||||
b.category.toLowerCase().includes(q) ||
|
||||
b.tags?.some((t) => t.toLowerCase().includes(q)),
|
||||
);
|
||||
}
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user