s3manager-web/views/icon.go
2017-03-30 22:48:27 +02:00

19 lines
302 B
Go

package views
import "path"
// icon returns an icon for a file type
func icon(fileName string) string {
e := path.Ext(fileName)
switch e {
case ".tgz":
return "archive"
case ".png", ".jpg", ".gif", ".svg":
return "photo"
case ".mp3":
return "music_note"
}
return "insert_drive_file"
}