EK
Size: a a a
EK
d
{ years: 0, months: 0, days: 18, hours: 0, minutes: 20, seconds: 0 }
В
EK
d
EK
b
b
d
d
b
EK
EK
if (role == "чёрт")...
d
b
В
В
0
import React from 'react'
const Student = ({ name }) => <p>Student name: {name}</p>
const Teacher = ({ name }) => <p>Teacher name: {name}</p>
const Guardian = ({ name }) => <p>Guardian name: {name}</p>
const COMPONENT_MAP = {
student: Student,
teacher: Teacher,
guardian: Guardian
}
export default function SampleComponent({ user }) {
const Component = COMPONENT_MAP[user.type]
return (
<div>
<Component name={user.name} />
</div>
)
}