refactor: useAlertStore 사용부 리팩토링

This commit is contained in:
2025-05-28 16:25:00 +09:00
parent f06a8e9637
commit 34ed19d14e
70 changed files with 70 additions and 73 deletions
@@ -17,7 +17,7 @@ function GeneralFileUploader<T extends { atflCd?: string | null }>({
deleteAttachmentIds: string[];
setDeleteAttachmentIds: (deleteAttachmentIds: string[]) => void;
}) {
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { bbsInfo } = useMenuStore((state) => state);
const [attachments, setAttachments] = useState<Record<string, Attachment>>(
@@ -20,7 +20,7 @@ function PostComment({ bbsId, pstNo }: { bbsId: number; pstNo: number }) {
const { confirm } = useConfirm();
const queryClient = useQueryClient();
const { userInfo } = useUserStore((state) => state);
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const [editingCmntNo, setEditingCmntNo] = useState<number | null>(null);
const [editValue, setEditValue] = useState<string>("");
@@ -21,7 +21,7 @@ import { PostComment } from "./post-comment";
function Post({ bbsId, pstNo }: { bbsId: string; pstNo: string }) {
const router = useRouter();
const { prompt } = usePrompt();
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { userInfo } = useUserStore((state) => state);
const { bbsInfo } = useMenuStore((state) => state);
@@ -168,7 +168,7 @@ function Post({ bbsId, pstNo }: { bbsId: string; pstNo: string }) {
<video src={videoUrl} controls className="object-contain" />
</div>
)}
<pre className="font-noto min-h-[40rem] whitespace-pre-wrap p-8 text-2xl tracking-tighter text-foreground">
<pre className="min-h-[40rem] whitespace-pre-wrap p-8 font-noto text-2xl tracking-tighter text-foreground">
{postData?.pstCn ?? ""}
</pre>
{isFetching ? (
@@ -16,7 +16,7 @@ function WithPreviewFileUploader<T extends PostFormData | PostUpdateFormData>({
form: UseFormReturn<T>;
attachmentData?: Attachment[];
}) {
const { setMessage: alert } = useAlertStore((state) => state);
const alert = useAlertStore((state) => state.setMessage);
const { bbsInfo } = useMenuStore((state) => state);
const [thumbnailUrl, setThumbnailUrl] = useState("");