web2019/static/js/shop/CrateMode.jsx
Egor Savkin 94f321ecf7 Minimal summary and crate mode
Signed-off-by: Egor Savkin <es@m-labs.hk>
2024-01-09 10:14:53 +08:00

21 lines
582 B
JavaScript

import React from 'react';
import {data as shared_data} from "./utils";
/**
* Component that displays crate modes
*/
export function CrateMode({current, onChange}) {
return (
<div className="crate-mode">
{shared_data.crateModeOrder.map(item => (
<a
key={item}
className={current === item ? 'active' : ''}
onClick={() => onChange(item)}
href="#"
role="button">{shared_data.crateModes[item].name}</a>
))}
</div>
);
}