Skip to content

Commit

Permalink
Fix error for accessing key prop in PublishDate
Browse files Browse the repository at this point in the history
  • Loading branch information
oBusk committed Jun 6, 2024
1 parent f5ac973 commit a713513
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/app/[...parts]/_page/DiffIntro/PublishDate.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { type ComponentPropsWithoutRef } from "react";
import ClientDate from "^/components/ClientDate";
import Skeleton from "^/components/ui/Skeleton";
import getVersionData from "^/lib/api/npm/getVersionData";
import { cx } from "^/lib/cva";
import type SimplePackageSpec from "^/lib/SimplePackageSpec";
import suspense from "^/lib/suspense";

export interface PublishDateProps extends ComponentPropsWithoutRef<"div"> {
export interface PublishDateProps {
className?: string;
pkg: SimplePackageSpec;
}

const shared = cx("my-1 flex h-5 items-center justify-center");

async function PublishDate({ pkg, className, ...props }: PublishDateProps) {
async function PublishDate({ pkg, className }: PublishDateProps) {
const versionData = await getVersionData(pkg);

const time = versionData[pkg.version]?.time ?? null;
Expand All @@ -21,7 +21,6 @@ async function PublishDate({ pkg, className, ...props }: PublishDateProps) {
<ClientDate
time={time}
className={cx(shared, "cursor-help", className)}
{...props}
/>
);
}
Expand Down

0 comments on commit a713513

Please sign in to comment.