A Neovim plugin enabling you to solve LeetCode problems.
| 1 | local t = require("leetcode.translator") |
| 2 | local Group = require("leetcode-ui.group") |
| 3 | |
| 4 | local config = require("leetcode.config") |
| 5 | local stats = require("leetcode-ui.lines.stats") |
| 6 | |
| 7 | ---@class lc.ui.menu.Footer : lc.ui.Group |
| 8 | local Footer = Group:extend("LeetFooter") |
| 9 | |
| 10 | |
| 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) |
| 25 | end |
| 26 | |
| 27 | ---@param opts? any |
| 28 | |
| 29 | opts = vim.tbl_deep_extend("force", { |
| 30 | hl = "Number", |
| 31 | spacing = 1, |
| 32 | }, opts or {}) |
| 33 | |
| 34 | Footer.super.init(self, {}, opts) |
| 35 | end |
| 36 | |
| 37 | ---@type fun(): lc.ui.menu.Footer |
| 38 | local LeetFooter = Footer |
| 39 | |
| 40 | return LeetFooter() |