Refactor SecurityPrivacySettings component

Refactor the SecurityPrivacySettings component into smaller, more manageable sub-components for improved readability and maintainability. The functionality of the page remains unchanged.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-15 23:27:21 +00:00
parent 435ea26556
commit 9631303b3c
7 changed files with 284 additions and 167 deletions

View File

@@ -0,0 +1,41 @@
import React from 'react';
import { Button } from '@/components/ui/button';
import { useNavigate } from 'react-router-dom';
import { useToast } from '@/hooks/use-toast';
type SaveSettingsButtonProps = {
onSave?: () => void;
};
const SaveSettingsButton = ({ onSave }: SaveSettingsButtonProps) => {
const navigate = useNavigate();
const { toast } = useToast();
const handleSave = () => {
// 사용자 정의 저장 함수가 있으면 실행
if (onSave) {
onSave();
}
// 기본 저장 동작
toast({
title: "보안 설정이 저장되었습니다.",
description: "변경사항이 성공적으로 적용되었습니다.",
});
navigate('/settings');
};
return (
<div className="px-6">
<Button
onClick={handleSave}
className="w-full bg-neuro-income text-white hover:bg-neuro-income/90"
>
</Button>
</div>
);
};
export default SaveSettingsButton;