'pdf',
'doc', 'docx' => 'word',
'xls', 'xlsx' => 'excel',
'ppt', 'pptx' => 'powerpoint',
'jpg', 'jpeg', 'png', 'gif' => 'image',
'zip', 'rar' => 'archive',
'txt' => 'text',
default => 'document'
};
}
public static function getFileIconClass($filename)
{
$fileType = self::getFileType($filename);
$classes = [
'pdf' => 'text-red-500',
'word' => 'text-blue-500',
'excel' => 'text-green-500',
'image' => 'text-yellow-500',
'archive' => 'text-purple-500',
'text' => 'text-gray-500',
'powerpoint' => 'text-orange-500',
'document' => 'text-gray-400'
];
return $classes[$fileType] ?? 'text-gray-400';
}
public static function getFileIconSvg($filename)
{
$fileType = self::getFileType($filename);
$colorClass = self::getFileIconClass($filename);
$icons = [
'pdf' => '',
'word' => '',
'excel' => '',
'image' => '',
'archive' => ''
];
return $icons[$fileType] ?? '';
}
}