mirror of
https://github.com/stackblitz/bolt.new
synced 2025-06-26 18:17:50 +00:00
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import { memo } from 'react';
|
|
import type { Template } from '~/types/template';
|
|
import { STARTER_TEMPLATES } from '~/utils/constants';
|
|
|
|
interface FrameworkLinkProps {
|
|
template: Template;
|
|
}
|
|
|
|
const FrameworkLink = memo<FrameworkLinkProps>(({ template }) => (
|
|
<a
|
|
href={`/git?url=https://github.com/${template.githubRepo}.git`}
|
|
data-state="closed"
|
|
data-discover="true"
|
|
className="items-center justify-center"
|
|
target="_self"
|
|
>
|
|
<img src={template.icon} alt={template.label} className="w-8 h-8 opacity-25 hover:opacity-75 transition-all" />
|
|
</a>
|
|
));
|
|
|
|
const StarterTemplates = memo(() => {
|
|
return (
|
|
<div className="flex flex-col items-center gap-4">
|
|
<span className="text-sm text-gray-500">or start a blank app with your favorite stack</span>
|
|
<div className="flex justify-center">
|
|
<div className="flex w-70 flex-wrap items-center justify-center gap-4">
|
|
{STARTER_TEMPLATES.map((template) => (
|
|
<FrameworkLink key={template.name} template={template} />
|
|
))}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
});
|
|
|
|
export default StarterTemplates;
|