refactor(event-grid): Refactor footer rendering in event grid container
Some checks failed
Client CMS Check Build (NixCN CMS) TeamCity build failed
Backend Check Build (NixCN CMS) TeamCity build finished

Signed-off-by: Noa Virellia <noa@requiem.garden>
This commit is contained in:
2026-02-08 17:25:16 +08:00
parent a315eea087
commit e6fc2f6130

View File

@@ -16,26 +16,23 @@ export function EventGridContainer() {
: (
<EventGridView
events={data.pages.flatMap(page => page.data ?? []).map(toEventInfo)}
footer={eventInfo => (eventInfo.isJoined
? <Button className="w-full" disabled></Button>
: (
eventInfo.requireKyc
? (
<KycDialogContainer event={eventInfo}>
footer={(eventInfo) => {
const Container = eventInfo.requireKyc ? KycDialogContainer : EventJoinDialogContainer;
return (
<Container event={eventInfo}>
{eventInfo.isJoined ? (
<Button className="w-full" disabled>
</Button>
) : (
<DialogTrigger asChild>
<Button className="w-full"></Button>
</DialogTrigger>
</KycDialogContainer>
)
: (
<EventJoinDialogContainer event={eventInfo}>
<DialogTrigger asChild>
<Button className="w-full"></Button>
</DialogTrigger>
</EventJoinDialogContainer>
)
)
)}
</Container>
);
}}
/>
)
);