1414 * limitations under the License.
1515 */
1616
17+ import TabHeader from "@/components/common/TabHeader" ;
18+ import { EditOutlined } from "@ant-design/icons" ;
19+ import { FluentEmoji , FluentEmojiProps , Hero , useControls , useCreateStore } from "@lobehub/ui" ;
20+ import { Link , useModel , useParams } from "@umijs/max" ;
21+ import { Avatar , Button , Flex , Result , Space , TabsProps , Typography } from "antd" ;
22+
1723const User : React . FC = ( ) => {
18- return < > User</ > ;
24+ const { initialState } = useModel ( '@@initialState' ) ;
25+ const param = useParams ( ) ;
26+
27+ const store = useCreateStore ( ) ;
28+ const control : FluentEmojiProps = useControls (
29+ {
30+ emoji : '😃' ,
31+ size : {
32+ max : 128 ,
33+ min : 16 ,
34+ step : 1 ,
35+ value : 64 ,
36+ } ,
37+ } ,
38+ { store } ,
39+ ) ;
40+
41+ // tab内容
42+ const items : TabsProps [ 'items' ] = [
43+ {
44+ key : 'creations' ,
45+ label : < Typography . Text > 作品</ Typography . Text > ,
46+ children : < Flex vertical justify = "center" align = "center" className = "h-96" > < Hero
47+ description = "敬请期待,马上到来!"
48+ actions = { [
49+ {
50+ link : '/modu/chat' ,
51+ text : '先和我聊聊' ,
52+ type : 'primary' ,
53+ } ,
54+ ] }
55+ title = "<b>. MODU</b> CHAT"
56+ /> </ Flex > ,
57+ } ,
58+ {
59+ key : 'favorites' ,
60+ label : < Typography . Text > 收藏</ Typography . Text > ,
61+ children : < Flex vertical justify = "center" align = "center" className = "h-96" > < Hero
62+ description = "敬请期待,马上到来!"
63+ actions = { [
64+ {
65+ link : '/modu/chat' ,
66+ text : '先和我聊聊' ,
67+ type : 'primary' ,
68+ } ,
69+ ] }
70+ title = "<b>. MODU</b> CHAT"
71+ /> </ Flex > ,
72+ } ,
73+ ]
74+
75+ return ( param . userUid !== initialState ?. userMe ?. uid
76+ ? ( < Flex vertical justify = "center" align = "center" className = "h-full w-full" >
77+ < Result
78+ status = "403"
79+ title = "403"
80+ subTitle = "暂未开放对其他用户的空间访问"
81+ extra = { < Button type = "primary" > < Link to = "/modu/chat" > 先和我聊聊</ Link > </ Button > }
82+ />
83+ </ Flex > )
84+ : ( < >
85+ < Flex className = "px-20 py-10" gap = { 20 } >
86+ < Avatar size = { 64 } icon = { < FluentEmoji type = { 'anim' } { ...control } /> } />
87+ < Flex vertical justify = "center" align = "flex-start" className = "h-16 flex-auto" >
88+ < Space align = "center" className = "h-8" >
89+ < Typography . Title level = { 3 } className = "!m-0" > { initialState ?. userMe ?. name } </ Typography . Title >
90+ < Typography . Text type = "secondary" > { initialState ?. userMe ?. email } </ Typography . Text >
91+ </ Space >
92+ < Flex justify = "flex-start" align = "center" className = "h-8" gap = { 10 } >
93+ < Typography . Text type = "secondary" > 这个用户很懒,什么都没有留下</ Typography . Text >
94+ < Button type = "text" size = "small" icon = { < Typography . Text type = "secondary" > < EditOutlined /> </ Typography . Text > } />
95+ </ Flex >
96+ </ Flex >
97+
98+ </ Flex >
99+ < Flex className = "px-20 py-5" >
100+ < TabHeader
101+ className = "w-full"
102+ contentNoPpadding
103+ items = { items }
104+ defaultActiveKey = 'creations'
105+ />
106+ </ Flex >
107+ </ >
108+ ) ) ;
19109} ;
20110
21111export default User ;
0 commit comments