This commit is contained in:
parent
c3ae27c7d7
commit
2d02a2840b
|
|
@ -8,10 +8,12 @@ import { Announcement } from "@/types/announcement"
|
||||||
import { IconExternalLink, IconSpeakerphone } from "@tabler/icons-react"
|
import { IconExternalLink, IconSpeakerphone } from "@tabler/icons-react"
|
||||||
import { FC, useEffect, useState } from "react"
|
import { FC, useEffect, useState } from "react"
|
||||||
import { SIDEBAR_ICON_SIZE } from "../sidebar/sidebar-switcher"
|
import { SIDEBAR_ICON_SIZE } from "../sidebar/sidebar-switcher"
|
||||||
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
interface AnnouncementsProps {}
|
interface AnnouncementsProps {}
|
||||||
|
|
||||||
export const Announcements: FC<AnnouncementsProps> = () => {
|
export const Announcements: FC<AnnouncementsProps> = () => {
|
||||||
|
const { t } = useTranslation()
|
||||||
const [announcements, setAnnouncements] = useState<Announcement[]>([])
|
const [announcements, setAnnouncements] = useState<Announcement[]>([])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -93,7 +95,7 @@ export const Announcements: FC<AnnouncementsProps> = () => {
|
||||||
<div className="grid gap-4">
|
<div className="grid gap-4">
|
||||||
<div>
|
<div>
|
||||||
<div className="mb-4 text-left text-xl font-bold leading-none">
|
<div className="mb-4 text-left text-xl font-bold leading-none">
|
||||||
Updates
|
{t("help.updates")}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="grid space-y-4">
|
<div className="grid space-y-4">
|
||||||
|
|
@ -120,13 +122,13 @@ export const Announcements: FC<AnnouncementsProps> = () => {
|
||||||
size="sm"
|
size="sm"
|
||||||
onClick={() => markAsRead(a.id)}
|
onClick={() => markAsRead(a.id)}
|
||||||
>
|
>
|
||||||
Mark as Read
|
{t("help.markAsRead")}
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
{a.link && (
|
{a.link && (
|
||||||
<a href={a.link} target="_blank" rel="noreferrer">
|
<a href={a.link} target="_blank" rel="noreferrer">
|
||||||
<Button className="h-[26px] text-xs" size="sm">
|
<Button className="h-[26px] text-xs" size="sm">
|
||||||
Demo{" "}
|
{t("help.demo")}{" "}
|
||||||
<IconExternalLink className="ml-1" size={14} />
|
<IconExternalLink className="ml-1" size={14} />
|
||||||
</Button>
|
</Button>
|
||||||
</a>
|
</a>
|
||||||
|
|
@ -144,17 +146,17 @@ export const Announcements: FC<AnnouncementsProps> = () => {
|
||||||
variant="outline"
|
variant="outline"
|
||||||
onClick={markAllAsRead}
|
onClick={markAllAsRead}
|
||||||
>
|
>
|
||||||
Mark All as Read
|
{t("help.markAllAsRead")}
|
||||||
</Button>
|
</Button>
|
||||||
) : (
|
) : (
|
||||||
<div className="text-muted-foreground text-sm leading-snug">
|
<div className="text-muted-foreground text-sm leading-snug">
|
||||||
You are all caught up!
|
{t("help.youAreAllCaughtUp")}
|
||||||
{announcements.length > 0 && (
|
{announcements.length > 0 && (
|
||||||
<div
|
<div
|
||||||
className="mt-6 cursor-pointer underline"
|
className="mt-6 cursor-pointer underline"
|
||||||
onClick={() => markAllAsUnread()}
|
onClick={() => markAllAsUnread()}
|
||||||
>
|
>
|
||||||
Show recent updates
|
{t("help.showRecentUpdates")}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue