const Logo = ({ className }) => {
return (
<div className={classNames(classes.logo, {}, [className])}>
<img src={require('images/logo.svg')} alt='logotype' />
<h2 className={classNames(classes.text)}>Healthy food</h2>
</div>
)
}
export default Logo
npx storybook@latest init
╭───────────────────────────────────────────────────────╮
│ │
│ Adding Storybook version 8.1.11 to your project.. │
│ │
╰───────────────────────────────────────────────────────╯
• Detecting project type. ✓
Installing dependencies...
up to date, audited 1161 packages in 3s
224 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
√
We were not able to detect the right builder for your project. Please select one: » Webpack 5
⠙ Getting the correct version of 11 packages
Error: Command failed with exit code 3221225477: npm info @storybook/react-webpack5 version --json
at makeError (C:\Users\Джамбулат\AppData\Local\npm-cache\_npx\bc7e1e37fcb46ffc\node_modules\execa\lib\error.js:60:11)
at handlePromise (C:\Users\Джамбулат\AppData\Local\npm-cache\_npx\bc7e1e37fcb46ffc\node_modules\execa\index.js:118:26)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async NPMProxy.executeCommand (C:\Users\Джамбулат\AppData\Local\npm-cache\_npx\bc7e1e37fcb46ffc\node_modules\@storybook\core-common\dist\index.js:35:1948)
at async NPMProxy.runGetVersions (C:\Users\Джамбулат\AppData\Local\npm-cache\_npx\bc7e1e37fcb46ffc\node_modules\@storybook\core-common\dist\index.js:37:417)
at async C:\Users\Джамбулат\AppData\Local\npm-cache\_npx\bc7e1e37fcb46ffc\node_modules\@storybook\core-common\dist\index.js:33:796
at async Promise.all (index 2)
at async baseGenerator (C:\Users\Джамбулат\AppData\Local\npm-cache\_npx\bc7e1e37fcb46ffc\node_modules\@storybook\cli\dist\generate.js:96:677)
at async generator8 (C:\Users\Джамбулат\AppData\Local\npm-cache\_npx\bc7e1e37fcb46ffc\node_modules\@storybook\cli\dist\generate.js:133:1267)
at async installStorybook (C:\Users\Джамбулат\AppData\Local\npm-cache\_npx\bc7e1e37fcb46ffc\node_modules\@storybook\cli\dist\generate.js:145:4834)
⠼ Getting the correct version of 11 packages
function findRoutes(routes) {
const dictionary = {};
const indegree = {};
routes.forEach(([from, to]) => {
dictionary[from] = to;
indegree[to] = (indegree[to] || 0) + 1;
});
const initialRoute = Object.keys(dictionary).find((el) => {
return !Object.keys(indegree).includes(el);
});
const stack = [initialRoute];
function checkRoutesPos(dictionary, initialRoute) {
let thisRoute = initialRoute;
let pushElem = dictionary[thisRoute];
while (pushElem !== undefined) {
thisRoute = dictionary[thisRoute];
stack.push(pushElem);
pushElem = dictionary[thisRoute];
}
}
checkRoutesPos(dictionary, initialRoute);
return stack.join(", ");
}
findRoute([ ["JPN", "PHL"], ["BRA", "UAE"], ["UAE", "JPN"], ["USA", "BRA"] ])
// Вывод ['JPN', 'PHL']
findRoute([ ["BRA", "UAE"], ["JPN", "PHL"], ["UAE", "JPN"], ["USA", "BRA"] ])
// Вывод ['BRA', 'UAE', 'JPN', 'PHL']