選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

page.tsx 7.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. 'use client';
  2. import { useState } from 'react';
  3. import {
  4. UploadOutlined,
  5. DeleteOutlined,
  6. } from '@ant-design/icons';
  7. import {
  8. Button,
  9. Input,
  10. Typography,
  11. Upload,
  12. Form,
  13. Row,
  14. Col,
  15. Divider,
  16. Flex,
  17. Image
  18. } from 'antd';
  19. import AltLayout from '@/components/layout/AltLayout';
  20. import PageTitle from '@/components/ui/PageTitle';
  21. const { Title, Text } = Typography;
  22. const ProfileSettings: React.FC = () => {
  23. const [companyName, setCompanyName] = useState('');
  24. const [role, setRole] = useState('');
  25. const [profileName, setProfileName] = useState('');
  26. const [newPassword, setNewPassword] = useState('');
  27. const [confirmPassword, setConfirmPassword] = useState('');
  28. return (
  29. <AltLayout header={<PageTitle backButton={true}>Profile Settings</PageTitle>}>
  30. <Row justify="center" className='!p-8'>
  31. <Col xs={24} sm={20} md={16} lg={12}>
  32. <Form layout="vertical" className="px-4 py-6 space-y-10">
  33. <Row>
  34. <Col span={24}>
  35. <Title level={5} className="!mb-3">Profile Photo</Title>
  36. <Flex vertical align="center" gap={16}>
  37. <Image
  38. src="/default-avatar.png"
  39. alt="Profile"
  40. className="w-20 h-20 rounded-full object-cover border"
  41. />
  42. <Upload showUploadList={false}>
  43. <Button icon={<UploadOutlined />} type="primary">
  44. Upload Photo
  45. </Button>
  46. </Upload>
  47. </Flex>
  48. </Col>
  49. <Divider />
  50. <Col span={24}>
  51. <Title level={5} className="!mb-3">Company Info</Title>
  52. <Row gutter={16}>
  53. <Col xs={24} sm={12}>
  54. <Form.Item label="Company Name">
  55. <Input
  56. placeholder="Company Name"
  57. value={companyName}
  58. onChange={(e) => setCompanyName(e.target.value)}
  59. />
  60. </Form.Item>
  61. </Col>
  62. <Col xs={24} sm={12}>
  63. <Form.Item label="My Role">
  64. <Input
  65. placeholder="My Role"
  66. value={role}
  67. onChange={(e) => setRole(e.target.value)}
  68. />
  69. </Form.Item>
  70. </Col>
  71. </Row>
  72. </Col>
  73. <Divider />
  74. {/* Profile Name */}
  75. <Col span={24}>
  76. <Title level={5} className="!mb-3">Profile Name</Title>
  77. <Form.Item label="Profile Name">
  78. <Input
  79. placeholder="Profile Name"
  80. value={profileName}
  81. onChange={(e) => setProfileName(e.target.value)}
  82. />
  83. </Form.Item>
  84. </Col>
  85. <Divider />
  86. {/* Change Password */}
  87. <Col span={24}>
  88. <Title level={5} className="!mb-3">Change Password</Title>
  89. <Row gutter={16}>
  90. <Col xs={24} sm={12}>
  91. <Form.Item label="New Password">
  92. <Input.Password
  93. placeholder="New Password"
  94. value={newPassword}
  95. onChange={(e) => setNewPassword(e.target.value)}
  96. />
  97. </Form.Item>
  98. </Col>
  99. <Col xs={24} sm={12}>
  100. <Form.Item label="Confirm Password">
  101. <Input.Password
  102. placeholder="Confirm Password"
  103. value={confirmPassword}
  104. onChange={(e) => setConfirmPassword(e.target.value)}
  105. />
  106. </Form.Item>
  107. </Col>
  108. </Row>
  109. <Button
  110. type="primary"
  111. className="mt-2"
  112. onClick={() => console.log('Change password confirmed')}
  113. >
  114. Save Password
  115. </Button>
  116. </Col>
  117. <Divider />
  118. {/* Delete Account */}
  119. <Col span={24}>
  120. <Flex align="center" gap={8} className="mb-2">
  121. <DeleteOutlined className="text-xl text-red-500" />
  122. <Text strong className="text-red-500">Delete Account</Text>
  123. </Flex>
  124. <Text type="danger">
  125. Your account and data will be permanently deleted. This action cannot be undone.
  126. </Text>
  127. <div className="mt-4">
  128. <Button
  129. danger
  130. type="primary"
  131. onClick={() => console.log('Account deletion confirmed')}
  132. >
  133. Delete Account
  134. </Button>
  135. </div>
  136. </Col>
  137. </Row>
  138. </Form>
  139. </Col>
  140. </Row>
  141. </AltLayout>
  142. );
  143. };
  144. export default ProfileSettings;