refactor: simplify preview generation

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-08-29 18:44:30 -04:00
parent 33a06c6509
commit 6b040ba19e
2 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ namespace KTXM\DocumentsManager;
use InvalidArgumentException;
use RuntimeException;
use KTXC\Preview\CachedPreview;
use KTXC\Preview\Preview;
use KTXC\Preview\PreviewManager;
use KTXC\Resource\ProviderManager;
use KTXF\Documents\Collection\CollectionBaseInterface;
@@ -1351,7 +1351,7 @@ class Manager {
/**
* Resolve an authorized entity and lazily generate or retrieve its preview.
*/
public function entityPreview(string $tenantId, string $userId, EntityIdentifier $target, string $variant = 'popover'): ?CachedPreview {
public function entityPreview(string $tenantId, string $userId, EntityIdentifier $target, string $variant = 'popover'): ?Preview {
$entities = $this->entityFetchBulk($tenantId, $userId, $target);
$entity = $entities[$target->entity()] ?? reset($entities);
if (!$entity instanceof EntityBaseInterface) {