mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-02 03:06:52 -05:00
34 lines
884 B
TypeScript
34 lines
884 B
TypeScript
import MyLink from "components/common/MyLink";
|
|
import { getVotingRange } from "utils/plus";
|
|
|
|
const VotingInfoHeader = ({ isMember }: { isMember: boolean }) => {
|
|
const { isHappening, endDate, nextVotingDate } = getVotingRange();
|
|
|
|
if (isHappening && isMember) {
|
|
return (
|
|
<>
|
|
Voting is open till {endDate.toLocaleString()}.{" "}
|
|
<MyLink href="/plus/voting">Go vote</MyLink> or{" "}
|
|
<MyLink href="/plus/history">view voting history</MyLink>
|
|
</>
|
|
);
|
|
}
|
|
|
|
if (isHappening)
|
|
return (
|
|
<>
|
|
Voting is happening till {endDate.toLocaleString()}.{" "}
|
|
<MyLink href="/plus/history">View voting history</MyLink>
|
|
</>
|
|
);
|
|
|
|
return (
|
|
<>
|
|
Next voting starts {nextVotingDate.toLocaleString()}.{" "}
|
|
<MyLink href="/plus/history">View voting history</MyLink>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default VotingInfoHeader;
|