Skip to content

Commit

Permalink
refactor(dashboard): small changes & lint
Browse files Browse the repository at this point in the history
  • Loading branch information
bryson-g committed Dec 7, 2024
1 parent f719690 commit df8ec07
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ export const WfRunsHeader: FC<Props> = ({ spec, currentStatus, currentWindow, se
<SelectTrigger className="w-[150px] min-w-fit">
<div className="flex items-center gap-2">
<ClockIcon className="h-5 w-5 fill-none stroke-black" />
<SelectValue>{currentWindow !== -1 ? `Last ${TIME_RANGES_NAMES[currentWindow]}` : TIME_RANGES_NAMES[currentWindow]}</SelectValue>
<SelectValue>
{currentWindow !== -1 ? `Last ${TIME_RANGES_NAMES[currentWindow]}` : TIME_RANGES_NAMES[currentWindow]}
</SelectValue>
</div>
</SelectTrigger>
<SelectContent>
Expand Down
11 changes: 9 additions & 2 deletions dashboard/src/app/[tenantId]/components/LinkWithTenant.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
'use client'
import { cn } from '@/components/utils'
import NextLink from 'next/link'
import { useParams } from 'next/navigation'
import { ComponentProps } from 'react'

const LinkWithTenant = ({ ...props }: ComponentProps<typeof NextLink>) => {
const LinkWithTenant = ({ linkStyle, ...props }: ComponentProps<typeof NextLink> & { linkStyle?: boolean }) => {
const { tenantId } = useParams()
return <NextLink {...props} href={`/${tenantId}${props.href}`} />
return (
<NextLink
{...props}
href={`/${tenantId}${props.href}`}
className={cn(props.className, { 'text-blue-500 underline': linkStyle })}
/>
)
}

export default LinkWithTenant
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,27 @@
import { UserTaskDef } from 'littlehorse-client/proto'
import { FC } from 'react'
import { Versions } from './Versions'
import { TagIcon } from 'lucide-react'

type Props = {
id: Pick<UserTaskDef, 'name' | 'version' | 'description'>
staticVersion?: boolean
}
export const Details: FC<Props> = ({ id }) => {
export const Details: FC<Props> = ({ id, staticVersion = false }) => {
return (
<div className="mb-4">
<span className="italic">UserTaskDef</span>
<h1 className="block text-2xl font-bold">{id.name}</h1>
{id.description && <div className="italic text-gray-400">{id.description}</div>}
<div className="flex flex-row gap-2 text-sm text-gray-500">
<Versions id={id} />
{staticVersion ? (
<div className="flex items-center gap-2">
<TagIcon className="h-5 w-5" />
{id.version}
</div>
) : (
<Versions id={id} />
)}
</div>
</div>
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client'
import { VersionSelector } from '@/app/[tenantId]/components/VersionSelector'
import { UserTaskDefId } from 'littlehorse-client/proto'
import { useParams } from 'next/navigation'
Expand Down

0 comments on commit df8ec07

Please sign in to comment.