release-notes-dialog.tsx 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. "use client";
  2. import * as React from "react";
  3. import { Bell } from "lucide-react";
  4. import { useCurrentLocale, useI18n } from "locales/client";
  5. import { formatDate } from "@/shared/lib/date";
  6. import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog";
  7. import { Button } from "@/components/ui/button";
  8. import { releaseNotes } from "../model/notes";
  9. export function ReleaseNotesDialog() {
  10. const t = useI18n();
  11. const locale = useCurrentLocale();
  12. return (
  13. <Dialog>
  14. <DialogTrigger asChild>
  15. <Button aria-label={t("release_notes.release_notes")} size="icon" variant="ghost">
  16. <span className="sr-only">{t("release_notes.release_notes")}</span>
  17. <Bell className="h-4 w-4" />
  18. </Button>
  19. </DialogTrigger>
  20. <DialogContent className="max-w-md">
  21. <DialogHeader>
  22. <DialogTitle>{t("release_notes.title")}</DialogTitle>
  23. </DialogHeader>
  24. <div className="space-y-4">
  25. {releaseNotes.map((note) => (
  26. <div className="border-b pb-2 last:border-b-0 last:pb-0" key={note.date}>
  27. <div className="text-xs text-muted-foreground">{formatDate(note.date, locale)}</div>
  28. <div className="font-semibold">{t(note.titleKey as keyof typeof t)}</div>
  29. <div className="text-sm">{t(note.contentKey as keyof typeof t)}</div>
  30. </div>
  31. ))}
  32. </div>
  33. </DialogContent>
  34. </Dialog>
  35. );
  36. }