irongit

A Neovim plugin enabling you to solve LeetCode problems.

40 lines952 BLua
1local t = require("leetcode.translator")
2local Group = require("leetcode-ui.group")
3
4local config = require("leetcode.config")
5local stats = require("leetcode-ui.lines.stats")
6
7---@class lc.ui.menu.Footer : lc.ui.Group
8local Footer = Group:extend("LeetFooter")
9
10function Footer:contents()
11 self:clear()
12
13 if config.auth.is_signed_in then
14 self:append(stats)
15 self:endgrp()
16
17 self:append(t("Signed in as") .. ": ", "leetcode_alt")
18 if config.auth.is_premium then
19 self:append(config.icons.star .. " ", "leetcode_medium")
20 end
21 self:append(config.auth.name):endl()
22 end
23
24 return Footer.super.contents(self)
25end
26
27---@param opts? any
28function Footer:init(opts)
29 opts = vim.tbl_deep_extend("force", {
30 hl = "Number",
31 spacing = 1,
32 }, opts or {})
33
34 Footer.super.init(self, {}, opts)
35end
36
37---@type fun(): lc.ui.menu.Footer
38local LeetFooter = Footer
39
40return LeetFooter()