Skip to content

armgit / pdfcn

Public Imported from GitHub
0

Beautiful pdf components, built on Takumi and Forme. 100% Free, Zero config, one command setup.

refactor: update demo imports in PdfPreview component for improved organization

Aniket-508af2a86809ac7
diff --git a/README.md b/README.md
index a27239c..b4d2662 100644
--- a/README.md
+++ b/README.md
@@ -51,8 +51,8 @@ Contributions are welcome! Please feel free to submit a Pull Request.
<a href="https://www.star-history.com/?repos=shadcn-labs%2Fpdfcn&type=date&legend=top-left">
<picture>
- <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=shadcn-labs/pdfcn&type=date&theme=dark&legend=top-left" />
- <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=shadcn-labs/pdfcn&type=date&legend=top-left" />
- <img alt="Star History Chart" src="https://api.star-history.com/chart?repos=shadcn-labs/pdfcn&type=date&legend=top-left" />
+ <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=shadcn-labs/pdfcn&type=date&theme=dark&legend=top-left&sealed_token=2BMBPgk0dLlhU5w4CRLlS7fk-9BTzo_UrGZLO2gkeTOGoukYcZCpw6UKjWSLwTWApLI7mHOY_bycA8u9dfhZfva3r-WfHwQ-UO_PPiBptc2uLfauypue61AXhyBT930oge5r3fv3a_v5InHq3WklV1K4zLmmUlCNbNcpdAA1utRF5aDhbyxHm8xFRmNT" />
+ <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=shadcn-labs/pdfcn&type=date&legend=top-left&sealed_token=2BMBPgk0dLlhU5w4CRLlS7fk-9BTzo_UrGZLO2gkeTOGoukYcZCpw6UKjWSLwTWApLI7mHOY_bycA8u9dfhZfva3r-WfHwQ-UO_PPiBptc2uLfauypue61AXhyBT930oge5r3fv3a_v5InHq3WklV1K4zLmmUlCNbNcpdAA1utRF5aDhbyxHm8xFRmNT" />
+ <img alt="Star History Chart" src="https://api.star-history.com/chart?repos=shadcn-labs/pdfcn&type=date&legend=top-left&sealed_token=2BMBPgk0dLlhU5w4CRLlS7fk-9BTzo_UrGZLO2gkeTOGoukYcZCpw6UKjWSLwTWApLI7mHOY_bycA8u9dfhZfva3r-WfHwQ-UO_PPiBptc2uLfauypue61AXhyBT930oge5r3fv3a_v5InHq3WklV1K4zLmmUlCNbNcpdAA1utRF5aDhbyxHm8xFRmNT" />
</picture>
</a>
diff --git a/components/pdf-preview.tsx b/components/pdf-preview.tsx
index 8adff35..ca50f14 100644
--- a/components/pdf-preview.tsx
+++ b/components/pdf-preview.tsx
@@ -90,12 +90,12 @@ export const PdfPreview = ({
{ fromJsx },
images,
] = await Promise.all([
- import("@/examples/__takumi__"),
+ import("@/examples/__index__"),
import("takumi-pdf"),
import("@takumi-rs/helpers/jsx"),
loadPreviewLogo(),
]);
- const Demo = demos[name];
+ const Demo = demos.takumi[name];
if (!Demo) {
throw new Error(`Unknown Takumi demo: ${name}`);
}
@@ -111,11 +111,11 @@ export const PdfPreview = ({
} else {
const [{ demos }, { renderSerializedDoc }, { serialize }] =
await Promise.all([
- import("@/examples/__forme__"),
+ import("@/examples/__index__"),
import("@formepdf/core/browser"),
import("@formepdf/react"),
]);
- const Demo = demos[name];
+ const Demo = demos.forme[name];
if (!Demo) {
throw new Error(`Unknown Forme demo: ${name}`);
}