Skip to content

Commit

Permalink
Update IconService.php
Browse files Browse the repository at this point in the history
  • Loading branch information
xIrusux authored Jan 9, 2025
1 parent 6d36bcf commit ebc6b27
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Icon/Service/IconService.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@

final class IconService implements IconServiceInterface
{
private string $defaultIcon = 'file-question-02';
private string $defaultIcon = 'unknown';

public function getIconForAsset(string $assetType, ?string $mimeType): ElementIcon
{
if ($assetType === 'document' && $mimeType !== null) {
$value = match ($mimeType) {
'application/vnd.openxmlformats-officedocument.presentationml.presentation' => 'presentation-chart-01',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'file-x-03',
'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => 'file-02',
'application/pdf' => 'file-check-02',
'application/vnd.openxmlformats-officedocument.presentationml.presentation' => 'presentation',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'xlsx-csv',
'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => 'txt-docs',
'application/pdf' => 'pdf',
default => $this->defaultIcon
};

Expand Down Expand Up @@ -69,8 +69,8 @@ public function getIconForDataObject(DataObjectSearchResultItem $dataObject): El
}

$value = match ($dataObject->getType()) {
ElementTypes::TYPE_OBJECT => 'mainObject',
ElementTypes::TYPE_VARIANT => 'mainObjectVariant',
ElementTypes::TYPE_OBJECT => 'data-object',
ElementTypes::TYPE_VARIANT => 'data-object-variant',
ElementTypes::TYPE_FOLDER => 'folder',
default => $this->defaultIcon
};
Expand Down

0 comments on commit ebc6b27

Please sign in to comment.