diff --git a/.gitignore b/.gitignore index 80ec311..b0426b7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ node_modules - +/.react-router /.cache /build .env diff --git a/app/components/Attribute.tsx b/app/components/Attribute.tsx index 1d8c6e6..256a16e 100644 --- a/app/components/Attribute.tsx +++ b/app/components/Attribute.tsx @@ -1,16 +1,15 @@ -import { CopyIcon } from '@primer/octicons-react' - -import { toast } from './Toaster' +import { CopyIcon } from '@primer/octicons-react'; +import { toast } from './Toaster'; interface Props { - name: string - value: string - isCopyable?: boolean - link?: string + name: string; + value: string; + isCopyable?: boolean; + link?: string; } export default function Attribute({ name, value, link, isCopyable }: Props) { - const canCopy = isCopyable ?? false + const canCopy = isCopyable ?? false; return (
+
{props.children}
- {props.isCopyable && (
+ {props.isCopyable && props.children ? (
- )}
+ ) : undefined}
>
- )
+ );
}
diff --git a/app/components/Dialog.tsx b/app/components/Dialog.tsx
index 9c43c0a..6e1d611 100644
--- a/app/components/Dialog.tsx
+++ b/app/components/Dialog.tsx
@@ -1,106 +1,99 @@
-/* eslint-disable unicorn/no-keyword-prefix */
-import { type Dispatch, type ReactNode, type SetStateAction } from 'react'
+import { Dispatch, ReactNode, SetStateAction } from 'react';
import {
Button as AriaButton,
Dialog as AriaDialog,
DialogTrigger,
Heading as AriaHeading,
Modal,
- ModalOverlay
-} from 'react-aria-components'
+ ModalOverlay,
+} from 'react-aria-components';
+import { cn } from '~/utils/cn';
-import { cn } from '~/utils/cn'
-
-type ButtonProperties = Parameters[0] & {
+type ButtonProps = Parameters[0] & {
readonly control?: [boolean, Dispatch>];
-}
+};
-function Button(properties: ButtonProperties) {
+function Button(props: ButtonProps) {
return (
{
- properties.control?.[1](true)
- } : undefined}
+ onPress={
+ props.control
+ ? () => {
+ props.control?.[1](true);
+ }
+ : undefined
+ }
/>
- )
+ );
}
-type ActionProperties = Parameters[0] & {
+type ActionProps = Parameters[0] & {
readonly variant: 'cancel' | 'confirm';
-}
+};
-function Action(properties: ActionProperties) {
+function Action(props: ActionProps) {
return (
- )
+ );
}
-function Title(properties: Parameters[0]) {
+function Title(props: Parameters[0]) {
return (
- )
+ );
}
-function Text(properties: React.HTMLProps) {
+function Text(props: React.HTMLProps) {
return (
-
- )
+
+ );
}
-type PanelProperties = {
- readonly children: (close: () => void) => ReactNode;
- readonly control?: [boolean, Dispatch>];
- readonly className?: string;
+interface PanelProps {
+ children: (close: () => void) => ReactNode;
+ control?: [boolean, Dispatch>];
+ className?: string;
}
-function Panel({ children, control, className }: PanelProperties) {
+function Panel({ children, control, className }: PanelProps) {
return (
- )
+ );
}
-type DialogProperties = {
- readonly children: ReactNode;
- readonly control?: [boolean, Dispatch>];
+interface DialogProps {
+ children: ReactNode;
+ control?: [boolean, Dispatch>];
}
-function Dialog({ children, control }: DialogProperties) {
+function Dialog({ children, control }: DialogProps) {
if (control) {
- return children
+ return children;
}
- return (
-
- {children}
-
- )
+ return {children} ;
}
-export default Object.assign(Dialog, { Button, Title, Text, Panel, Action })
+export default Object.assign(Dialog, { Button, Title, Text, Panel, Action });
diff --git a/app/components/Error.tsx b/app/components/Error.tsx
index 79ae97f..e5f942b 100644
--- a/app/components/Error.tsx
+++ b/app/components/Error.tsx
@@ -1,19 +1,18 @@
-import { AlertIcon } from '@primer/octicons-react'
-import { isRouteErrorResponse, useRouteError } from '@remix-run/react'
+import { AlertIcon } from '@primer/octicons-react';
+import { isRouteErrorResponse, useRouteError } from 'react-router';
+import { cn } from '~/utils/cn';
+import Card from './Card';
+import Code from './Code';
-import { cn } from '~/utils/cn'
-
-import Card from './Card'
-import Code from './Code'
-
-type Properties = {
- readonly type?: 'full' | 'embedded';
+interface Props {
+ type?: 'full' | 'embedded';
}
-export function ErrorPopup({ type = 'full' }: Properties) {
- const error = useRouteError()
- const routing = isRouteErrorResponse(error)
- const message = (error instanceof Error ? error.message : 'An unexpected error occurred')
+export function ErrorPopup({ type = 'full' }: Props) {
+ const error = useRouteError();
+ const routing = isRouteErrorResponse(error);
+ const message =
+ error instanceof Error ? error.message : 'An unexpected error occurred';
return (
-
-
+
+
{routing ? error.status : 'Error'}
-
+
-
- {routing ? (
- error.statusText
- ) : (
-
- {message}
-
- )}
+
+ {routing ? error.statusText : {message}}
- )
+ );
}
diff --git a/app/components/Footer.tsx b/app/components/Footer.tsx
index 4a949b9..132e129 100644
--- a/app/components/Footer.tsx
+++ b/app/components/Footer.tsx
@@ -1,44 +1,36 @@
-import { cn } from '~/utils/cn'
-import Link from '~/components/Link'
+import { cn } from '~/utils/cn';
+import Link from '~/components/Link';
interface FooterProps {
- url: string
- debug: boolean
+ url: string;
+ debug: boolean;
}
export default function Footer({ url, debug, integration }: FooterProps) {
return (
-
- )
+ );
}
diff --git a/app/components/Link.tsx b/app/components/Link.tsx
index 0f78a95..fbd30fa 100644
--- a/app/components/Link.tsx
+++ b/app/components/Link.tsx
@@ -1,12 +1,11 @@
-import { LinkExternalIcon } from '@primer/octicons-react'
-
-import { cn } from '~/utils/cn'
+import { LinkExternalIcon } from '@primer/octicons-react';
+import { cn } from '~/utils/cn';
interface Props {
- to: string
- name: string
- children: string
- className?: string
+ to: string;
+ name: string;
+ children: string;
+ className?: string;
}
export default function Link({ to, name: alt, children, className }: Props) {
@@ -26,5 +25,5 @@ export default function Link({ to, name: alt, children, className }: Props) {
{children}
- )
+ );
}
diff --git a/app/components/Menu.tsx b/app/components/Menu.tsx
index 6898320..6eb975d 100644
--- a/app/components/Menu.tsx
+++ b/app/components/Menu.tsx
@@ -1,98 +1,91 @@
-import { type Dispatch, type ReactNode, type SetStateAction } from 'react'
+import { Dispatch, ReactNode, SetStateAction } from 'react';
import {
Button as AriaButton,
Menu as AriaMenu,
MenuItem,
MenuTrigger,
- Popover
-} from 'react-aria-components'
+ Popover,
+} from 'react-aria-components';
+import { cn } from '~/utils/cn';
-import { cn } from '~/utils/cn'
-
-function Button(properties: Parameters[0]) {
+function Button(props: Parameters[0]) {
return (
- )
+ );
}
-function Items(properties: Parameters[0]) {
+function Items(props: Parameters[0]) {
return (
-
- {properties.children}
+ {props.children}
- )
+ );
}
-type ButtonProperties = Parameters[0] & {
+type ButtonProps = Parameters[0] & {
readonly control?: [boolean, Dispatch>];
-}
+};
-function ItemButton(properties: ButtonProperties) {
+function ItemButton(props: ButtonProps) {
return (
-