migrate to app dir and ssr

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-01-20 22:54:38 +01:00
parent 719a82f1c4
commit 308ae98472
194 changed files with 4706 additions and 2194 deletions

View File

@@ -1,3 +1,5 @@
'use client';
import { Button } from '@/components/ui/button';
import { X } from 'lucide-react';
@@ -17,16 +19,23 @@ export function ModalContent({ children }: ModalContentProps) {
interface ModalHeaderProps {
title: string | React.ReactNode;
onClose?: (() => void) | false;
}
export function ModalHeader({ title }: ModalHeaderProps) {
export function ModalHeader({ title, onClose }: ModalHeaderProps) {
return (
<div className="flex items-center justify-between mb-6">
<div className="font-medium">{title}</div>
<Button variant="ghost" size="sm" onClick={() => popModal()}>
<X className="h-4 w-4" />
<span className="sr-only">Close</span>
</Button>
{onClose !== false && (
<Button
variant="ghost"
size="sm"
onClick={() => (onClose ? onClose() : popModal())}
>
<X className="h-4 w-4" />
<span className="sr-only">Close</span>
</Button>
)}
</div>
);
}