rsnext/examples/with-turbopack/ui/SkeletonCard.tsx
Jared Palmer 24787089cf
Add turbopack example (#41789)
<!--
Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change that you're making:
-->

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm lint`
- [x] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-25 10:21:53 -07:00

16 lines
643 B
TypeScript

import clsx from 'clsx';
export const SkeletonCard = ({ isLoading }: { isLoading?: boolean }) => (
<div
className={clsx('rounded-2xl bg-zinc-900/80 p-4', {
'relative overflow-hidden before:absolute before:inset-0 before:-translate-x-full before:animate-[shimmer_1.5s_infinite] before:bg-gradient-to-r before:from-transparent before:via-white/10 before:to-transparent':
isLoading,
})}
>
<div className="space-y-3">
<div className="h-14 rounded-lg bg-zinc-700" />
<div className="h-3 w-11/12 rounded-lg bg-zinc-700" />
<div className="h-3 w-8/12 rounded-lg bg-zinc-700" />
</div>
</div>
);