-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(dashboard): global details component
should be used to unify the design and codebase in the future.
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 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,37 @@ | ||
import { TagIcon } from 'lucide-react' | ||
import { FC } from 'react' | ||
import { Versions } from '../userTaskDef/[...props]/components/Versions' | ||
|
||
export type DetailsProps = { | ||
itemHeader: string | ||
header: string | ||
version?: number[] | ||
status?: string | ||
description?: Record<string, string | React.ReactNode> | ||
} | ||
|
||
export const Details: FC<DetailsProps> = ({ itemHeader, header, version, status, description }) => { | ||
return ( | ||
<div> | ||
<div className="mb-4"> | ||
<span className="italic">{itemHeader}</span> | ||
<h1 className="block text-2xl font-bold">{header}</h1> | ||
<div className="flex flex-row gap-2 text-sm text-gray-500"> | ||
{version && version.length > 1 ? ( | ||
<div className="flex items-center gap-2"> | ||
<TagIcon className="h-5 w-5" /> | ||
{version[0]} | ||
</div> | ||
) : null} | ||
</div> | ||
{description && | ||
Object.entries(description).map(([key, value]) => ( | ||
<div key={key}> | ||
<b>{key}</b>: {value} | ||
</div> | ||
))} | ||
{status && <div className="italic text-gray-400">{status}</div>} | ||
</div> | ||
</div> | ||
) | ||
} |