Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

page.tsx 7.0KB

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