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 5.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. 'use client'
  2. import {
  3. UploadOutlined,
  4. DeleteOutlined
  5. } from '@ant-design/icons'
  6. import { Button, Input, Typography, Upload, Form } from 'antd'
  7. import { useState } from 'react'
  8. const { Title, Text } = Typography
  9. const ProfileSettings = () => {
  10. const [companyName, setCompanyName] = useState('')
  11. const [role, setRole] = useState('')
  12. const [profileName, setProfileName] = useState('')
  13. const [newPassword, setNewPassword] = useState('')
  14. const [confirmPassword, setConfirmPassword] = useState('')
  15. return (
  16. <Form layout="vertical" className="!flex !flex-col !gap-y-8 !max-w-2xl !mx-auto !p-5">
  17. {/* 1. Profile Photo */}
  18. <div>
  19. <p className="font-bold text-white bg-pink-300 py-1 px-5 w-fit rounded-full">
  20. Profile Photo
  21. </p>
  22. <div className="flex flex-col items-center gap-4 mt-4">
  23. <img
  24. src="/default-avatar.png"
  25. alt="Profile"
  26. className="w-20 h-20 rounded-full object-cover border"
  27. />
  28. <Upload showUploadList={false}>
  29. <Button type='primary'>
  30. <span className='font-bold'>Upload Photo</span>
  31. </Button>
  32. </Upload>
  33. </div>
  34. </div>
  35. {/* 2. Company Info */}
  36. <div>
  37. <p className="font-bold text-white bg-pink-300 py-1 px-5 w-fit rounded-full">
  38. Company Info
  39. </p>
  40. <div className="grid grid-cols-1 sm:grid-cols-2 gap-4 mt-4">
  41. <Form.Item label={<Title level={5}>Company Name</Title>}>
  42. <Input
  43. placeholder="Company Name"
  44. value={companyName}
  45. onChange={(e) => setCompanyName(e.target.value)}
  46. />
  47. </Form.Item>
  48. <Form.Item label={<Title level={5}>My Role</Title>}>
  49. <Input
  50. placeholder="My Role"
  51. value={role}
  52. onChange={(e) => setRole(e.target.value)}
  53. />
  54. </Form.Item>
  55. </div>
  56. </div>
  57. {/* 3. Profile Name */}
  58. <div>
  59. <p className="font-bold text-white bg-pink-300 py-1 px-5 w-fit rounded-full">
  60. Profile Name
  61. </p>
  62. <div className="mt-4">
  63. <Form.Item label={<Title level={5}>Profile Name</Title>}>
  64. <Input
  65. placeholder="Profile Name"
  66. value={profileName}
  67. onChange={(e) => setProfileName(e.target.value)}
  68. />
  69. </Form.Item>
  70. </div>
  71. </div>
  72. {/* 4. Change Password */}
  73. <div>
  74. <p className="font-bold text-white bg-pink-300 py-1 px-5 w-fit rounded-full">
  75. Change Password
  76. </p>
  77. <div className="grid grid-cols-1 sm:grid-cols-2 gap-4 mt-4">
  78. <Form.Item label={<Title level={5}>New Password</Title>}>
  79. <Input.Password
  80. placeholder="New Password"
  81. value={newPassword}
  82. onChange={(e) => setNewPassword(e.target.value)}
  83. />
  84. </Form.Item>
  85. <Form.Item label={<Title level={5}>Confirm Password</Title>}>
  86. <Input.Password
  87. placeholder="Confirm Password"
  88. value={confirmPassword}
  89. onChange={(e) => setConfirmPassword(e.target.value)}
  90. />
  91. </Form.Item>
  92. </div>
  93. <Button
  94. type="primary"
  95. className="mt-4 w-fit mx-auto"
  96. onClick={() => console.log('Change password confirmed')}
  97. >
  98. <span className='px-10 font-bold'>Save</span>
  99. </Button>
  100. </div>
  101. {/* 5. Delete Account */}
  102. <div>
  103. <div className="flex items-center gap-2 mb-2">
  104. <DeleteOutlined className="text-xl" style={{ color: "red" }} />
  105. <p className="font-bold text-red-600 py-1 w-fit">
  106. Delete Account
  107. </p>
  108. </div>
  109. <Text type="danger">
  110. Your account and data will be permanently deleted.
  111. </Text>
  112. <div className="mt-4 flex flex-col">
  113. <Button
  114. danger
  115. className='w-fit mx-auto'
  116. type="primary"
  117. onClick={() => console.log('Account deletion confirmed')}
  118. >
  119. <span className='px-10 font-bold'>Delete</span>
  120. </Button>
  121. </div>
  122. </div>
  123. </Form>
  124. )
  125. }
  126. export default ProfileSettings