-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
228cc13
commit 5744e5a
Showing
3 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
apps/website/src/app/(local-pages)/shadcn/static/client-component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
'use client' | ||
|
||
import { | ||
InputOTP, | ||
InputOTPGroup, | ||
InputOTPSeparator, | ||
InputOTPSlot, | ||
} from '@/components/ui/input-otp' | ||
import React from 'react' | ||
|
||
export function ClientComp() { | ||
const [value, setValue] = React.useState('') | ||
|
||
return ( | ||
<form className="container relative flex-1 flex flex-col justify-center items-center"> | ||
<InputOTP | ||
value={value} | ||
onChange={setValue} | ||
maxLength={6} | ||
render={({ slots }) => ( | ||
<> | ||
<InputOTPGroup> | ||
{slots.slice(0, 3).map((slot, index) => ( | ||
<InputOTPSlot key={index} {...slot} /> | ||
))}{' '} | ||
</InputOTPGroup> | ||
<InputOTPSeparator /> | ||
<InputOTPGroup> | ||
{slots.slice(3).map((slot, index) => ( | ||
<InputOTPSlot key={index} {...slot} /> | ||
))} | ||
</InputOTPGroup> | ||
</> | ||
)} | ||
/> | ||
</form> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'use server' | ||
|
||
import { ClientComp } from './client-component' | ||
|
||
export default async function StaticPage() { | ||
return ( | ||
<> | ||
<ClientComp /> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters