style: format code

This commit is contained in:
Jewgeni Lewash 2024-03-10 19:48:09 +01:00
parent b18424b921
commit 899341b39e
3 changed files with 616 additions and 638 deletions

1068
.astro/icon.d.ts vendored

File diff suppressed because it is too large Load Diff

2
.astro/types.d.ts vendored
View File

@ -223,5 +223,5 @@ declare module 'astro:content' {
type AnyEntryMap = ContentEntryMap & DataEntryMap; type AnyEntryMap = ContentEntryMap & DataEntryMap;
export type ContentConfig = typeof import("../src/content/config.js"); export type ContentConfig = typeof import("./../src/content/config.js");
} }

View File

@ -1,117 +1,95 @@
import * as React from "react" import * as React from 'react';
import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react" import { ChevronLeft, ChevronRight, MoreHorizontal } from 'lucide-react';
import { cn } from "@/lib/utils" import { cn } from '@/lib/utils';
import { ButtonProps, buttonVariants } from "@/components/ui/button" import { type ButtonProps, buttonVariants } from '@/components/ui/button';
const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => ( const Pagination = ({ className, ...props }: React.ComponentProps<'nav'>) => (
<nav <nav
role="navigation" role="navigation"
aria-label="pagination" aria-label="pagination"
className={cn("mx-auto flex w-full justify-center", className)} className={cn('mx-auto flex w-full justify-center', className)}
{...props} {...props}
/> />
) );
Pagination.displayName = "Pagination" Pagination.displayName = 'Pagination';
const PaginationContent = React.forwardRef< const PaginationContent = React.forwardRef<HTMLUListElement, React.ComponentProps<'ul'>>(
HTMLUListElement, ({ className, ...props }, ref) => (
React.ComponentProps<"ul"> <ul ref={ref} className={cn('flex flex-row items-center gap-1', className)} {...props} />
>(({ className, ...props }, ref) => ( )
<ul );
ref={ref} PaginationContent.displayName = 'PaginationContent';
className={cn("flex flex-row items-center gap-1", className)}
{...props}
/>
))
PaginationContent.displayName = "PaginationContent"
const PaginationItem = React.forwardRef< const PaginationItem = React.forwardRef<HTMLLIElement, React.ComponentProps<'li'>>(
HTMLLIElement, ({ className, ...props }, ref) => <li ref={ref} className={cn('', className)} {...props} />
React.ComponentProps<"li"> );
>(({ className, ...props }, ref) => ( PaginationItem.displayName = 'PaginationItem';
<li ref={ref} className={cn("", className)} {...props} />
))
PaginationItem.displayName = "PaginationItem"
type PaginationLinkProps = { type PaginationLinkProps = {
isActive?: boolean isActive?: boolean;
} & Pick<ButtonProps, "size"> & } & Pick<ButtonProps, 'size'> &
React.ComponentProps<"a"> React.ComponentProps<'a'>;
const PaginationLink = ({ const PaginationLink = ({ className, isActive, size = 'icon', ...props }: PaginationLinkProps) => (
className, <a
isActive, aria-current={isActive ? 'page' : undefined}
size = "icon", className={cn(
...props buttonVariants({
}: PaginationLinkProps) => ( variant: isActive ? 'outline' : 'ghost',
<a size,
aria-current={isActive ? "page" : undefined} }),
className={cn( className
buttonVariants({ )}
variant: isActive ? "outline" : "ghost", {...props}
size, />
}), );
className PaginationLink.displayName = 'PaginationLink';
)}
{...props}
/>
)
PaginationLink.displayName = "PaginationLink"
const PaginationPrevious = ({ const PaginationPrevious = ({
className, className,
...props ...props
}: React.ComponentProps<typeof PaginationLink>) => ( }: React.ComponentProps<typeof PaginationLink>) => (
<PaginationLink <PaginationLink
aria-label="Go to previous page" aria-label="Go to previous page"
size="default" size="default"
className={cn("gap-1 pl-2.5", className)} className={cn('gap-1 pl-2.5', className)}
{...props} {...props}>
> <ChevronLeft className="h-4 w-4" />
<ChevronLeft className="h-4 w-4" /> <span>Previous</span>
<span>Previous</span> </PaginationLink>
</PaginationLink> );
) PaginationPrevious.displayName = 'PaginationPrevious';
PaginationPrevious.displayName = "PaginationPrevious"
const PaginationNext = ({ const PaginationNext = ({ className, ...props }: React.ComponentProps<typeof PaginationLink>) => (
className, <PaginationLink
...props aria-label="Go to next page"
}: React.ComponentProps<typeof PaginationLink>) => ( size="default"
<PaginationLink className={cn('gap-1 pr-2.5', className)}
aria-label="Go to next page" {...props}>
size="default" <span>Next</span>
className={cn("gap-1 pr-2.5", className)} <ChevronRight className="h-4 w-4" />
{...props} </PaginationLink>
> );
<span>Next</span> PaginationNext.displayName = 'PaginationNext';
<ChevronRight className="h-4 w-4" />
</PaginationLink>
)
PaginationNext.displayName = "PaginationNext"
const PaginationEllipsis = ({ const PaginationEllipsis = ({ className, ...props }: React.ComponentProps<'span'>) => (
className, <span
...props aria-hidden
}: React.ComponentProps<"span">) => ( className={cn('flex h-9 w-9 items-center justify-center', className)}
<span {...props}>
aria-hidden <MoreHorizontal className="h-4 w-4" />
className={cn("flex h-9 w-9 items-center justify-center", className)} <span className="sr-only">More pages</span>
{...props} </span>
> );
<MoreHorizontal className="h-4 w-4" /> PaginationEllipsis.displayName = 'PaginationEllipsis';
<span className="sr-only">More pages</span>
</span>
)
PaginationEllipsis.displayName = "PaginationEllipsis"
export { export {
Pagination, Pagination,
PaginationContent, PaginationContent,
PaginationEllipsis, PaginationEllipsis,
PaginationItem, PaginationItem,
PaginationLink, PaginationLink,
PaginationNext, PaginationNext,
PaginationPrevious, PaginationPrevious,
} };