fix: make tags optional in ChangelogEntry, remove unused VoteState import
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { PortableTextRenderer } from '@/components/PortableTextRenderer'
|
import { PortableTextRenderer } from '@/components/PortableTextRenderer'
|
||||||
import type { ChangelogEntry, RoadmapItemData, Tab, VoteState } from '@/types/changelog'
|
import type { ChangelogEntry, RoadmapItemData, Tab } from '@/types/changelog'
|
||||||
|
|
||||||
const TABS: { id: Tab; label: string }[] = [
|
const TABS: { id: Tab; label: string }[] = [
|
||||||
{ id: 'whats-new', label: "What's New" },
|
{ id: 'whats-new', label: "What's New" },
|
||||||
@@ -86,9 +86,9 @@ export function ChangelogTabs({
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{entry.tags?.length > 0 && (
|
{(entry.tags?.length ?? 0) > 0 && (
|
||||||
<div className="mb-2.5 flex flex-wrap gap-1.5">
|
<div className="mb-2.5 flex flex-wrap gap-1.5">
|
||||||
{entry.tags.map((tag) => (
|
{(entry.tags ?? []).map((tag) => (
|
||||||
<span
|
<span
|
||||||
key={tag}
|
key={tag}
|
||||||
className={`rounded-full px-2 py-0.5 text-[10px] font-bold uppercase tracking-wide ${
|
className={`rounded-full px-2 py-0.5 text-[10px] font-bold uppercase tracking-wide ${
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@ export type ChangelogEntry = {
|
|||||||
title: string
|
title: string
|
||||||
version: string
|
version: string
|
||||||
publishedAt: string
|
publishedAt: string
|
||||||
tags: string[]
|
tags?: string[]
|
||||||
body: unknown[]
|
body: unknown[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user