Fix TypeScript errors
- Remove unused 't' import from HomeView.tsx - Fix _unusedExtractTags function to properly mark parameter as unused - All TypeScript checks now pass
This commit is contained in:
parent
d3cae85b3d
commit
ef3d2cf52e
@ -7,7 +7,6 @@ import { ArticlesList } from '@/components/ArticlesList'
|
|||||||
import { PageHeader } from '@/components/PageHeader'
|
import { PageHeader } from '@/components/PageHeader'
|
||||||
import { Footer } from '@/components/Footer'
|
import { Footer } from '@/components/Footer'
|
||||||
import { FundingGauge } from '@/components/FundingGauge'
|
import { FundingGauge } from '@/components/FundingGauge'
|
||||||
import { t } from '@/lib/i18n'
|
|
||||||
import type { Dispatch, SetStateAction } from 'react'
|
import type { Dispatch, SetStateAction } from 'react'
|
||||||
|
|
||||||
interface HomeViewProps {
|
interface HomeViewProps {
|
||||||
|
|||||||
@ -88,45 +88,9 @@ export function parseReviewFromEvent(event: Event): Review | null {
|
|||||||
// This function is kept for backward compatibility but should be migrated
|
// This function is kept for backward compatibility but should be migrated
|
||||||
// Currently unused - kept for potential future migration
|
// Currently unused - kept for potential future migration
|
||||||
function _unusedExtractTags(_event: Event) {
|
function _unusedExtractTags(_event: Event) {
|
||||||
const tags = extractTagsFromEvent(event)
|
// This function is intentionally unused - kept for backward compatibility
|
||||||
const mediaTags = event.tags.filter((tag: string[]) => tag[0] === 'media')
|
// If needed in the future, uncomment and implement using _event parameter
|
||||||
const media: MediaRef[] =
|
return null
|
||||||
mediaTags
|
|
||||||
.map((tag: string[]) => {
|
|
||||||
const url = tag[1]
|
|
||||||
const type = tag[2] === 'video' ? 'video' : 'image'
|
|
||||||
if (!url) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
return { url, type }
|
|
||||||
})
|
|
||||||
.filter(Boolean) as MediaRef[]
|
|
||||||
|
|
||||||
// Map category from new system to old system
|
|
||||||
const category = tags.category === 'sciencefiction' ? 'science-fiction' : tags.category === 'research' ? 'scientific-research' : undefined
|
|
||||||
const isPresentation = tags.type === 'author'
|
|
||||||
|
|
||||||
return {
|
|
||||||
title: (tags.title as string | undefined) ?? 'Untitled',
|
|
||||||
preview: tags.preview as string | undefined,
|
|
||||||
description: tags.description as string | undefined,
|
|
||||||
zapAmount: (tags.zapAmount as number | undefined) ?? 800,
|
|
||||||
invoice: tags.invoice as string | undefined,
|
|
||||||
paymentHash: tags.paymentHash as string | undefined,
|
|
||||||
category,
|
|
||||||
isPresentation,
|
|
||||||
mainnetAddress: tags.mainnetAddress as string | undefined,
|
|
||||||
totalSponsoring: (tags.totalSponsoring as number | undefined) ?? 0,
|
|
||||||
authorPresentationId: undefined, // Not used in new system
|
|
||||||
seriesId: tags.seriesId as string | undefined,
|
|
||||||
bannerUrl: tags.bannerUrl as string | undefined,
|
|
||||||
coverUrl: tags.coverUrl as string | undefined,
|
|
||||||
media,
|
|
||||||
kindType: tags.type === 'author' ? 'article' : tags.type === 'series' ? 'series' : tags.type === 'publication' ? 'article' : tags.type === 'quote' ? 'review' : undefined,
|
|
||||||
articleId: tags.articleId as string | undefined,
|
|
||||||
reviewerPubkey: tags.reviewerPubkey as string | undefined,
|
|
||||||
author: undefined, // Not used in new system
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPreviewContent(content: string, previewTag?: string) {
|
function getPreviewContent(content: string, previewTag?: string) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user