mirror of
https://github.com/spliit-app/spliit.git
synced 2026-02-27 01:46:12 +01:00
Update group header component to include data-testid for improved test targeting and update Page Object Model to use the more reliable test ID selector. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
33 lines
949 B
TypeScript
33 lines
949 B
TypeScript
'use client'
|
|
|
|
import { GroupTabs } from '@/app/groups/[groupId]/group-tabs'
|
|
import { ShareButton } from '@/app/groups/[groupId]/share-button'
|
|
import { Skeleton } from '@/components/ui/skeleton'
|
|
import Link from 'next/link'
|
|
import { useCurrentGroup } from './current-group-context'
|
|
|
|
export const GroupHeader = () => {
|
|
const { isLoading, groupId, group } = useCurrentGroup()
|
|
|
|
return (
|
|
<div className="flex flex-col justify-between gap-3">
|
|
<h1 className="font-bold text-2xl">
|
|
<Link href={`/groups/${groupId}`}>
|
|
{isLoading ? (
|
|
<Skeleton className="mt-1.5 mb-1.5 h-5 w-32" />
|
|
) : (
|
|
<div className="flex" data-testid="group-name">
|
|
{group.name}
|
|
</div>
|
|
)}
|
|
</Link>
|
|
</h1>
|
|
|
|
<div className="flex gap-2 justify-between">
|
|
<GroupTabs groupId={groupId} />
|
|
{group && <ShareButton group={group} />}
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|