feat: 컴포넌트 추가, 스타일 수정

This commit is contained in:
2026-04-10 12:23:48 +09:00
parent a836333512
commit 35f6023f5a
19 changed files with 1263 additions and 56 deletions

View File

@@ -0,0 +1,29 @@
'use client';
import { useSyncExternalStore } from 'react';
import { modalStore } from './store';
export const ModalRenderer = () => {
const modals = useSyncExternalStore(modalStore.subscribe, modalStore.getSnapshot, modalStore.getServerSnapshot);
return (
<>
{modals.map((modal) => {
const { Component, props, id, resolve } = modal;
return (
<Component
key={id}
{...props}
isOpen={true}
onOpenChange={(open: boolean) => {
if (!open) {
resolve();
modalStore.removeModal(id);
}
}}
/>
);
})}
</>
);
};