-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create .nvmrc * Add foundations for viz * ✨ * 🙈 * 🙈 * Fix useFile hook * ✂️ * Remove Sparkle from viz
- Loading branch information
Showing
11 changed files
with
1,180 additions
and
81 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
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,3 +1,12 @@ | ||
{ | ||
"extends": "next/core-web-vitals" | ||
"extends": [ | ||
"next/core-web-vitals", | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"rules": { | ||
"eqeqeq": "error", | ||
"no-unused-vars": "error", | ||
"@typescript-eslint/no-explicit-any": "error" | ||
} | ||
} |
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 @@ | ||
20.13.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
"use client"; | ||
|
||
// We can't use Sparkle components in the viz app, | ||
// because of client-side rendering issue. | ||
// So we define the components here. | ||
|
||
export const Button = ({ | ||
label, | ||
onClick, | ||
}: { | ||
label: string; | ||
onClick: () => void; | ||
}) => { | ||
return ( | ||
<button | ||
onClick={onClick} | ||
className="px-4 py-2 text-sm font-medium text-white bg-blue-500 rounded hover:bg-blue-600" | ||
> | ||
{label} | ||
</button> | ||
); | ||
}; | ||
|
||
export const ErrorMessage = ({ | ||
children, | ||
title, | ||
}: { | ||
children: React.ReactNode; | ||
title: string; | ||
}) => { | ||
return ( | ||
<div className="bg-pink-100 border-l-4 border-pink-500 rounded-lg p-4 max-w-md"> | ||
<div className="flex items-center mb-2"> | ||
<svg | ||
className="w-6 h-6 text-pink-500 mr-2" | ||
fill="currentColor" | ||
viewBox="0 0 20 20" | ||
> | ||
<path | ||
fillRule="evenodd" | ||
d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" | ||
clipRule="evenodd" | ||
/> | ||
</svg> | ||
<h3 className="text-lg font-semibold text-pink-800">{title}</h3> | ||
</div> | ||
<div className="text-pink-700">{children}</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export const Spinner = () => { | ||
return ( | ||
<div className="flex items-center justify-center"> | ||
<div className="w-8 h-8 border-4 border-blue-500 border-t-transparent border-solid rounded-full animate-spin"></div> | ||
</div> | ||
); | ||
}; |
Oops, something went wrong.