feat: add SoonestStays
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
"use client"
|
||||
|
||||
import { Lang } from "@/constants/languages"
|
||||
import { _ } from "@/lib/translation"
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
|
||||
@@ -11,9 +12,20 @@ import StayList from "../StayList"
|
||||
import EmptyPreviousStaysBlock from "./EmptyPreviousStays"
|
||||
|
||||
import type { Page } from "@/types/components/myPages/myStays/page"
|
||||
import type { LangParams } from "@/types/params"
|
||||
|
||||
export default function PreviousStays({ lang }: LangParams) {
|
||||
type PreviousStaysProps = {
|
||||
lang: Lang
|
||||
title: string
|
||||
subtitle?: string
|
||||
link: { href: string; text: string } | null
|
||||
}
|
||||
|
||||
export default function PreviousStays({
|
||||
lang,
|
||||
title,
|
||||
subtitle,
|
||||
link,
|
||||
}: PreviousStaysProps) {
|
||||
const { data, isFetching, fetchNextPage, hasNextPage } =
|
||||
trpc.user.stays.previous.useInfiniteQuery(
|
||||
{},
|
||||
@@ -28,12 +40,8 @@ export default function PreviousStays({ lang }: LangParams) {
|
||||
|
||||
return (
|
||||
<Container>
|
||||
<Header
|
||||
title={_("Previous stays")}
|
||||
subtitle={_(
|
||||
"Revisit your stays and rekindle those our moments together, with ease."
|
||||
)}
|
||||
/>
|
||||
<Header title={title} subtitle={subtitle} link={link} />
|
||||
|
||||
{data?.pages.length ? (
|
||||
<ListContainer>
|
||||
<StayList
|
||||
|
||||
Reference in New Issue
Block a user