-
Notifications
You must be signed in to change notification settings - Fork 103
Expand file tree
/
Copy pathImage.lua
More file actions
50 lines (43 loc) · 1.08 KB
/
Image.lua
File metadata and controls
50 lines (43 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
-- @Liquipedia
-- page=Module:Widget/Image/Icon/Image
--
-- Please see https://github.com/Liquipedia/Lua-Modules to contribute
--
local Lua = require('Module:Lua')
local Class = Lua.import('Module:Class')
local Image = Lua.import('Module:Image')
local WidgetIcon = Lua.import('Module:Widget/Image/Icon')
---@class IconImageWidgetParameters
---@field imageLight string?
---@field imageDark string?
---@field link string?
---@field size string?
---@field caption string?
---@field alt string?
---@field alignment string?
---@field location string?
---@class IconImageWidget: IconWidget
---@operator call(IconImageWidgetParameters): IconImageWidget
---@field props IconImageWidgetParameters
local Icon = Class.new(WidgetIcon)
Icon.defaultProps = {
link = '',
size = 'x20px'
}
---@return string?
function Icon:render()
return Image.display(
self.props.imageLight,
self.props.imageDark,
{
link = self.props.link,
size = self.props.size,
caption = self.props.caption,
alt = self.props.alt,
alignment = self.props.alignment,
location = self.props.location,
}
)
end
return Icon