Skip to content

Commit

Permalink
fix: typescript errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rccsousa committed Oct 25, 2024
1 parent 65578c8 commit e207a15
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/_blocks/EpisodeHead/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function EpisodeHead({ episode }) {
<div className={styles.metadataContainer}>
{/* First Column */}
<div className={styles.metadata}>
<ArchiveButton collection={'podcast-episodes'} color={'var(--soft-white-100)'} />
<ArchiveButton collection={'podcasts'} color={'var(--soft-white-100)'} />
<h5>{title}</h5>
<h6>episode.podcastName property</h6>
<p>
Expand Down
3 changes: 2 additions & 1 deletion src/app/_components/ContentCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ export default function ContentCard({ contentType, content, rounded }: ContentSu
"--dynamic-border": rounded ? "45px" : "",
};

// todo: convert to a collection item property
// Given Payload type structure an error is expected as content_html only exists in Blogposts
// @ts-expect-error
const readTime = contentType === 'Blogposts' ? estimateReadTime(content.content_html) : ''

return (
Expand Down
2 changes: 1 addition & 1 deletion src/app/_utilities/estimateReadTime.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function estimateReadTime(text: string | null): string {
export function estimateReadTime(text: string): string {
const WPM = 250
const wordCount = text.split(/\s+/).length
const readTimeMinutes = Math.ceil(wordCount / WPM)
Expand Down

0 comments on commit e207a15

Please sign in to comment.