This repository has been archived by the owner on Jan 16, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: initial work on edit/delete/view (#38)
- Loading branch information
1 parent
f93764e
commit ad8e887
Showing
75 changed files
with
3,407 additions
and
1,592 deletions.
There are no files selected for viewing
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 @@ | ||
nodejs 20.10.0 |
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
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,29 @@ | ||
import {LightBulbIcon, PlusIcon} from '@heroicons/react/24/outline'; | ||
|
||
import {Button} from './ui/button'; | ||
|
||
export function EmptyState({ | ||
title, | ||
description, | ||
cta, | ||
onClick, | ||
}: { | ||
title: string; | ||
description: string; | ||
cta: string; | ||
onClick: () => void; | ||
}) { | ||
return ( | ||
<div className="text-center"> | ||
<LightBulbIcon className="mx-auto h-10 w-10 text-gray-400 dark:text-gray-600" /> | ||
<h3 className="mt-2 text-base font-semibold">{title}</h3> | ||
<p className="mt-1 text-sm text-muted-foreground">{description}</p> | ||
<div className="mt-6"> | ||
<Button type="button" variant="default" onClick={onClick}> | ||
<PlusIcon className="mr-2 h-4 w-4" aria-hidden="true" /> | ||
<div>{cta}</div> | ||
</Button> | ||
</div> | ||
</div> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,20 +1,50 @@ | ||
import {isRouteErrorResponse, useRouteError} from '@remix-run/react'; | ||
|
||
import {ErrorPage} from './error-page.tsx'; | ||
import { | ||
Card, | ||
CardContent, | ||
CardDescription, | ||
CardHeader, | ||
CardTitle, | ||
} from '~/components/ui/card'; | ||
|
||
export function ErrorBox({ | ||
statusCode = 500, | ||
messages = [ | ||
"We couldn't process your request. Don't worry, we're notified and we'll resolve whatever caused this.", | ||
], | ||
}: { | ||
statusCode?: number; | ||
messages?: Array<string>; | ||
}) { | ||
return ( | ||
<div className="flex h-full flex-col items-center pt-8 text-center"> | ||
<Card className="w-[420px]"> | ||
<CardHeader> | ||
<CardDescription>{statusCode}</CardDescription> | ||
<CardTitle>Something went wrong</CardTitle> | ||
</CardHeader> | ||
<CardContent className="text-md text-balance text-muted-foreground"> | ||
{messages} | ||
</CardContent> | ||
</Card> | ||
</div> | ||
); | ||
} | ||
|
||
export function BaseErrorBoundary() { | ||
const error = useRouteError(); | ||
|
||
if (isRouteErrorResponse(error)) { | ||
if (error.status === 500) { | ||
return <ErrorPage />; | ||
return <ErrorBox />; | ||
} | ||
|
||
return ( | ||
// eslint-disable-next-line | ||
<ErrorPage statusCode={error.status} messages={error.data?.errors} /> | ||
<ErrorBox statusCode={error.status} messages={error.data?.errors} /> | ||
); | ||
} | ||
|
||
return <ErrorPage />; | ||
return <ErrorBox />; | ||
} |
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.