Skip to content

Commit 4970829

Browse files
committed
fix: randomw fixes
1 parent ad340bc commit 4970829

File tree

7 files changed

+53
-24
lines changed

7 files changed

+53
-24
lines changed

apps/www/app/docs/@aside/[name]/page.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import Link from "next/link";
12
import {
23
Card,
34
CardContent,
@@ -35,18 +36,21 @@ export default function HookAside() {
3536
</CardHeader>
3637
<CardContent>
3738
<div className="space-y-2 text-sm">
38-
<a
39+
<Link
3940
href="/docs/use-local-storage"
4041
className="block hover:text-blue-500"
4142
>
4243
useLocalStorage
43-
</a>
44-
<a href="/docs/use-counter" className="block hover:text-blue-500">
44+
</Link>
45+
<Link
46+
href="/docs/use-counter"
47+
className="block hover:text-blue-500"
48+
>
4549
useCounter
46-
</a>
47-
<a href="/docs/use-toggle" className="block hover:text-blue-500">
50+
</Link>
51+
<Link href="/docs/use-toggle" className="block hover:text-blue-500">
4852
useToggle
49-
</a>
53+
</Link>
5054
</div>
5155
</CardContent>
5256
</Card>

apps/www/app/docs/@aside/page.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import Link from "next/link";
12
import {
23
Card,
34
CardHeader,
@@ -35,18 +36,21 @@ export default function DocsAside() {
3536
</CardHeader>
3637
<CardContent>
3738
<div className="space-y-2 text-sm">
38-
<a
39+
<Link
3940
href="/docs/use-local-storage"
4041
className="block hover:text-blue-500"
4142
>
4243
useLocalStorage
43-
</a>
44-
<a href="/docs/use-counter" className="block hover:text-blue-500">
44+
</Link>
45+
<Link
46+
href="/docs/use-counter"
47+
className="block hover:text-blue-500"
48+
>
4549
useCounter
46-
</a>
47-
<a href="/docs/use-toggle" className="block hover:text-blue-500">
50+
</Link>
51+
<Link href="/docs/use-toggle" className="block hover:text-blue-500">
4852
useToggle
49-
</a>
53+
</Link>
5054
</div>
5155
</CardContent>
5256
</Card>

apps/www/app/docs/@details/[name]/page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Link from "next/link";
2+
import type { Metadata } from "next";
23
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
34
import { oneDark } from "react-syntax-highlighter/dist/esm/styles/prism";
45
import {
@@ -22,7 +23,7 @@ export async function generateMetadata({
2223
params,
2324
}: {
2425
params: Promise<{ name: string }>;
25-
}) {
26+
}): Promise<Metadata> {
2627
const { name } = await params;
2728
const hooks = await getHooks();
2829
const hook = hooks.find((h) => h.name === name);
@@ -180,6 +181,7 @@ export default async function HookPage({
180181
<h1 className="text-4xl font-bold mb-2 flex justify-between">
181182
{hook.title} <ShareButton />
182183
</h1>
184+
183185
<span className="inline-block bg-gray-200 dark:bg-slate-700 text-sm px-2 py-1 rounded mb-8">
184186
{hook.category}
185187
</span>

apps/www/app/docs/@details/cli/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,8 @@ export default async function CliPage() {
479479
Search for hooks by keyword with interactive selection.
480480
</p>
481481
<Terminal>
482-
npx usehooks-cli@latest search "fetch" --interactive --add
482+
npx usehooks-cli@latest search &quot;fetch&quot; --interactive
483+
--add
483484
</Terminal>
484485
</Step>
485486

apps/www/app/docs/@details/introduction/page.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ export default function IntroductionPage() {
2424
Introduction
2525
</h1>
2626
<p className="text-xl text-muted-foreground">
27-
This is not a hook library. It's how you build your hook library.
27+
This is not a hook library. It&apos;s how you build your hook
28+
library.
2829
</p>
2930
</div>
3031

@@ -35,7 +36,7 @@ export default function IntroductionPage() {
3536
</p>
3637
<p className="text-lg leading-7">
3738
This approach works well until you need to customize a hook to fit
38-
your specific needs or require one that isn't included in the
39+
your specific needs or require one that isn&apos;t included in the
3940
library. Often, you end up wrapping library hooks, writing
4041
workarounds, or mixing hooks from different libraries with
4142
incompatible APIs.
@@ -111,9 +112,9 @@ export default function IntroductionPage() {
111112
</div>
112113

113114
<p className="text-sm text-muted-foreground">
114-
In a typical library, if you need to change a hook's behavior, you
115-
have to override implementations or wrap the hook. With useHooks.io,
116-
you simply edit the hook code directly.
115+
In a typical library, if you need to change a hook&apos;s behavior,
116+
you have to override implementations or wrap the hook. With
117+
useHooks.io, you simply edit the hook code directly.
117118
</p>
118119
</section>
119120

@@ -235,7 +236,7 @@ export default function IntroductionPage() {
235236

236237
<Callout>
237238
<p className="text-sm">
238-
<strong>Note:</strong> The CLI is inspired by shadcn/ui's
239+
<strong>Note:</strong> The CLI is inspired by shadcn/ui&apos;s
239240
component workflow, making it easy to add and manage hooks in your
240241
React applications.
241242
</p>

apps/www/app/docs/@details/mcp/page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export default function McpPage() {
130130
<ul className="list-disc list-inside font-mono text-sm ml-4">
131131
<li>category (optional): Filter hooks by category</li>
132132
<li>
133-
format (optional): Output format ("json" or "markdown")
133+
format (optional): Output format (&quot;json&quot; or &quot;markdown&quot;)
134134
</li>
135135
</ul>
136136
</div>
@@ -156,12 +156,12 @@ export default function McpPage() {
156156
<p className="text-gray-600 mb-2">
157157
Search hooks by name or description
158158
</p>
159-
<div className="bg-accentp-3 rounded">
159+
<div className="bg-accent p-3 rounded">
160160
<p className="font-mono text-sm">Parameters:</p>
161161
<ul className="list-disc list-inside font-mono text-sm ml-4">
162162
<li>keyword: Search term (minimum 2 characters)</li>
163163
<li>
164-
format (optional): Output format ("json" or "markdown")
164+
format (optional): Output format (&quot;json&quot; or &quot;markdown&quot;)
165165
</li>
166166
<li>category (optional): Filter results by category</li>
167167
</ul>
@@ -178,7 +178,7 @@ export default function McpPage() {
178178
<ul className="list-disc list-inside font-mono text-sm ml-4">
179179
<li>name: Name of the hook to retrieve</li>
180180
<li>
181-
format (optional): Output format ("json" or "markdown")
181+
format (optional): Output format (&quot;json&quot; or &quot;markdown&quot;)
182182
</li>
183183
<li>include_examples (optional): Include usage examples</li>
184184
</ul>

apps/www/components/code-block.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
"use client";
2+
3+
import { useEffect, useState } from "react";
14
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
25
import { oneDark } from "react-syntax-highlighter/dist/esm/styles/prism";
36

@@ -29,8 +32,22 @@ export function CodeBlock({
2932
language = "typescript",
3033
showLineNumbers = true,
3134
}: CodeBlockProps) {
35+
const [isClient, setIsClient] = useState(false);
3236
const codeString = getTextContent(children);
3337

38+
useEffect(() => {
39+
setIsClient(true);
40+
}, []);
41+
42+
// Fallback for SSR
43+
if (!isClient) {
44+
return (
45+
<pre className="bg-gray-900 text-gray-100 p-4 rounded-md overflow-x-auto text-sm">
46+
<code>{codeString}</code>
47+
</pre>
48+
);
49+
}
50+
3451
return (
3552
<SyntaxHighlighter
3653
language={language}

0 commit comments

Comments
 (0)