-
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.
Complete the implementation of frontend
* Improve the server load by slowing down requests.
- Loading branch information
1 parent
9bee45b
commit fd6e0b9
Showing
21 changed files
with
641 additions
and
3 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 @@ | ||
__pycache__/* |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import ArrowUpTrayIcon from "../icons/ArrowUpTray"; | ||
import { FilterIcon } from "../icons/Filter"; | ||
|
||
export default function Search({filterEnabled, filterIconPressed, uploadIconPressed}: {filterIconPressed: () => void; filterEnabled: boolean; uploadIconPressed: () => void}) { | ||
return ( | ||
<div className="flex h-10 w-6/12 bg-neutral-900 hover:ring-1 hover:ring-neutral-400 focus-within:outline focus-within:outline-2 text-white rounded-3xl flex-row px-4"> | ||
<input className="h-full flex-1 bg-transparent text-white outline-none placeholder:text-neutral-400" type="search" placeholder="Search for a person..." /> | ||
<div className="flex gap-2"> | ||
<button onClick={filterIconPressed}> | ||
<FilterIcon filled={filterEnabled} className="h-full size-6 text-neutral-400 hover:text-white" /> | ||
</button> | ||
<button onClick={uploadIconPressed}> | ||
<ArrowUpTrayIcon className="h-full size-6 text-neutral-400 hover:text-white" /> | ||
</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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
export default function Table({headers, data}:{headers: string[], data: string[][]}) { | ||
return ( | ||
<div className="flex bg-neutral-900 rounded-3xl outline outline-2 outline-neutral-400 gap-4 text-white"> | ||
<div className="overflow-x-auto"> | ||
<table className="table-auto divide-y-2 divide-neutral-400"> | ||
<thead className=""> | ||
<tr className="divide-x-2 divide-neutral-400"> | ||
{headers.map((header, index) => <th key={index} className="px-4 py-2">{header}</th>)} | ||
</tr> | ||
</thead> | ||
<tbody className="divide-y-2 divide-neutral-800"> | ||
{data.map((row, index) => ( | ||
<tr key={index} className="odd:bg-neutral-950 divide-x-2 divide-neutral-800 even:bg-neutral-900"> | ||
{row.map((cell, index) => <td key={index} className="px-4 py-2 w-fit max-w-md">{ | ||
(cell.toString()).startsWith("http") ? <a href={`${cell}`} target="_blank" className="text-blue-500 hover:underline">{cell}</a> : cell | ||
}</td>) | ||
} | ||
</tr> | ||
))} | ||
</tbody> | ||
</table> | ||
</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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { createContext, useContext } from "react"; | ||
|
||
type FileContextType = { | ||
file: File | null; | ||
setFile: React.Dispatch<React.SetStateAction<File | null>>; | ||
taskId: string | null; | ||
} | ||
|
||
export const FileContext = createContext<FileContextType | undefined>(undefined); | ||
|
||
export default function useFileContext() { | ||
const context = useContext(FileContext); | ||
if (!context) { | ||
return null | ||
} | ||
return context; | ||
} |
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,18 @@ | ||
export default function ArrowDownTray({ className }: { className?: string }) { | ||
return ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
fill="none" | ||
viewBox="0 0 24 24" | ||
strokeWidth={1.5} | ||
stroke="currentColor" | ||
className={className} | ||
> | ||
<path | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
d="M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3" | ||
/> | ||
</svg> | ||
); | ||
} |
Oops, something went wrong.