text stringlengths 14 100k | source stringclasses 1
value | repo stringclasses 810
values | language stringclasses 13
values |
|---|---|---|---|
<|fim_prefix|>const { PrismaClient } = require('@prisma/client');
const cities = require('./data/cities.json');
const countries = require('./data/countries.json');
const states = require('./data/states.json');
const prisma = new PrismaClient();
async function main() {
console.log('Seeding started...');
console.... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import clsx from 'clsx';
import Link from 'next/link';
import { useRouter } from 'next/router';
import { sig<|fim_suffix|> />
)}
</Menu.Button>
</div>
<Transition
as={Fragment}
enter="transition ease-out duration-100"
enterFrom="transform opacity-0 sca... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import {
BriefcaseIcon,
CurrencyDollarIcon,
DocumentTextIcon,
} from '@heroicons/react/24/outline';
type GlobalNavigationItem = Readonly<{
href: string;
icon: (props: React.ComponentProps<'svg'>) => JSX.Element;
name: <|fim_suffix|>>;
const globalNavigation: GlobalNavigationItems = [
{ hre... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|> page_path: window.location.pathname,
});
`,
}}
id="google-analytics"
/>
</GoogleAnalyticsContext.Provider>
);
}
<|fim_prefix|>import { useRouter } from 'next/router';
import Script from 'next/script';
import { createContext, useContext, useEffect } ... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>' },
// { href: '/questions', name: 'Question Bank' },
// {
// children: [
// { href: '/resumes', name: 'View Resumes' },
// { href: '/resumes/submit', name: 'Submit Resume' },
// ],
// href: '#',
// name: 'Resumes',
// },
// ];
const config = {
navigation: [],
showG... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import clsx from 'clsx';
import Link from 'next/link';
import { Fragment } from 'react';
import { Dialog, Transition } from '@headlessui/react';
import { XMarkIcon } from '@heroicons/react/24/outline';
import { HorizontalDivider } from '~/ui';
import type { GlobalNavigationItems } from './GlobalNavigatio... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>ransition
as={Fragment}
enter="transition ease-out duration-100"
enterFrom="transform opacity-0 scale-95"
enterTo="transform opacity-100 scale-100"
leave="transition ease-in duration-75"
leaveFrom="transform op... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|> 'text-xs font-medium text-slate-600 sm:text-sm',
index > 0 && 'ml-4',
step != null ? 'hover:text-primary-500' : 'cursor-default',
step === currentStep && 'text-primary-500',
)}
type="button"
{...(step != null
... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>formation-security': 'Information Security',
'information-systems': 'Information Systems',
'management-science-and-engineering':
'Management Science and Engineering (MS&E)',
'materials-science': 'Materials Science',
mathematics: 'Mathematics',
'mechanical-engineering': 'Mechanical Engineerin... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>ducationLevelOptions = [emptyOption].concat(
EducationLevelLabels.map((label) => ({
label,
value: label.replace(/\s+/g, '-').toLowerCase(),
})),
);
<|fim_prefix|>import { emptyOption } from './con<|fim_middle|>stants';
export const EducationLevelLabels = [
'Bachelor',
'Diploma',
'Master... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>(),
})),
);
export const InternshipCycleValuesToLabels: Record<string, string> = {
fall: 'Fall',
'full-year': 'Full year',
'half-year': 'Half year',
others: 'Others',
spring: 'Spring',
summer: 'Summer',
winter: 'Winter',
};
<|fim_prefix|>import { emptyOpti<|fim_middle|>on } from './consta... | fim | yangshun/tech-interview-handbook | typescript |
import clsx from 'clsx';
import { JobType } from '@prisma/client';
import { JobTypeLabel } from '~/components/offers/constants';
type Props = Readonly<{
onChange: (jobType: JobType) => void;
value: JobType;
}>;
const tabs = [
{
label: JobTypeLabel.FULLTIME,
value: JobType.FULLTIME,
},
{
label: ... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>dashboard' },
{ href: '/offers/features', name: 'Features' },
{ href: '/offers/about', name: 'About' },
];
const navigationAdmin: ProductNavigationItems = [
{ href: '/offers/submit', name: 'Analyze your offers' },
{ href: '/offers/dashboard', name: 'My dashboard' },
{ href: '/offers/features', ... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>const NUM_YEARS = 5;
const OFFSET = 2;
export const YearsOptions = (yearSelected?<|fim_suffix|>Selected - OFFSET + i
: new Date().getFullYear() - OFFSET + i;
return {
label: String(year),
value: year,
};
});
<|fim_middle|>: number) =>
Array.from({ length: NUM_YEARS }, (_, i) ... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>cky right-0 drop-shadow md:drop-shadow-none',
)}
scope="col"
onClick={
onSort &&
sortType &&
(() => {
onSort(
sortDirection
? getOppositeSortOrder(sortDirection)
: OFFER_TABLE_SORT_ORDER.ASC,
sortType,
... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import clsx from 'clsx';
import Link from 'next/link';
import { JobType } from '@prisma/client';
import type { JobTitleType } from '~/components/shared/JobTitles';
import { getLabelForJobTitleType } from '~/components/shared/JobTitles';
import { convertMoneyToString } from '~/utils/offers/currency';
imp... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>& (
<div className="flex justify-center py-32">
<Spinner display="block" size="lg" />
</div>
)}
{!isLoading && (!offers || offers.length === 0) && (
<div className="py-16 text-lg">
<div className="flex justify-center">No data yet 🥺</di... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import { useEffect, useState } from 'react';
import { Pagination, Spinner } from '~/ui';
import type { Paging } from '~/types/offers';
type OffersTablePaginationProps = Readonly<{
endNumber: number;
handlePageChange: (page: number) => void;
isInitialFetch?: boolean;
isLoading?: boolean;
pagina... | fim | yangshun/tech-interview-handbook | typescript |
// eslint-disable-next-line no-shadow
export enum YOE_CATEGORY {
ENTRY = 'entry',
INTERN = 'intern',
MID = 'mid',
SENIOR = 'senior',
}
export const YOE_CATEGORY_PARAM: Record<string, number> = {
entry: 1,
intern: 0,
mid: 2,
senior: 3,
};
export const OfferTableYoeOptions = [
{ label: 'All Full Time ... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>export const HOME_URL = '/offers';
export const OFFERS_SUBMIT_URL = '/offers/submit';
export const JobTypeLabel = {
FULLTIME: 'Full-time',
INTERN: 'Internship',
};
export const emptyOption = {
label: '',
value: '',
};
export enum FieldError {
NON_NEGATIVE_NUMBER = 'Please fill in a non-negati... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import {
ArrowTrendingUpIcon,
BuildingOfficeIcon,
MapPinIcon,
} from '@heroicons/react/20/solid';
import { JobType } from '@prisma/client';
import { JobTypeLabel } from '~/components/offers/constants';
import CompanyProfileImage from '~/components/shared/CompanyProfileImage';
import type { JobTitle... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import { useRouter } from 'next/router';
import { BookmarkSlashIcon } from '@heroicons/react/20/solid';
import { ArrowRightIcon } from '@heroicons/react/24/outline';
import { Button, useToast } from '~/ui';
import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics';
import DashboardOfferCar... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import type { StaticImageData } from 'next/image';
import Image from 'next/image';
import type { ReactNode } from 'react';
type LeftTextCardProps = Readonly<{
buttonLabel: string;
description: string;
icon: ReactNode;
imageAlt: string;
imageSrc: StaticImageData;
title: string;
url:<|fim_suf... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import type { StaticImageData } from 'next/image';
import Image from 'next/image';
import type { ReactNode } from 'react';
type RightTextCarddProps = Readonly<{
buttonLabel: string;
description: string;
icon: ReactNode;
imageAlt: string;
imageSrc: StaticImageData;
title: string;
url: string... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>mes.label,
});
return (
<CitiesTypeahead
label="Location"
{...props}
value={{
id: watchCityId,
label: watchCityName,
value: watchCityId,
}}
onSelect={(option) => {
setValue(names.value, option?.value);
setValue(names.label, opt... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>ue(names.label, option?.label);
}}
/>
);
}
<|fim_prefix|>import type { ComponentProps } from 'react';
import { useFormContext, useWatch } from 'react-hook-form';
import CompaniesTypeahead from '~/components/shared/CompaniesTypeahead';
type Props = Omit<
ComponentProps<typeof CompaniesTypea... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>ame, option?.value);
}}
/>
);
}
<|fim_prefix|>import type { ComponentProps } from 'react';
import { useFormContext, useWatch } from 'react-hook-form';
import type { JobTitleType } from <|fim_middle|>'~/components/shared/JobTitles';
import { getLabelForJobTitleType } from '~/components/shared/... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>rdRef(FormMonthYearPickerWithRef);
export default FormMonthYearPicker;
<|fim_prefix|>import type { ComponentProps } from 'react';
import { forwardRef } from 'react';
import { use<|fim_middle|>FormContext, useWatch } from 'react-hook-form';
import MonthYearPicker from '~/components/shared/MonthYearPicker... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import type { ComponentProps } from 'react';
import { useFormContext } from 'react-hook-form';
import { RadioList } from '~/ui';
type RadioListProps = ComponentProps<typeof RadioList>;
type FormRadioListProps = Omit<RadioListProps, 'onChange'>;
export default f<|fim_suffix|> />
);
}
<|fim_middle|>unc... | fim | yangshun/tech-interview-handbook | typescript |
import { HorizontalDivider } from '~/ui';
export default function FormSection({
children,
title,
}: Readonly<{ children: React.ReactNode; title: string }>) {
return (
<div>
<div className="mb-4">
<h2 className="text-lg font-medium leading-6 text-slate-900">
{title}
</h2>
... | fim | yangshun/tech-interview-handbook | typescript |
import type { ComponentProps, ForwardedRef } from 'react';
import { forwardRef } from 'react';
import { useFormContext } from 'react-hook-form';
import { Select } from '~/ui';
type SelectProps = ComponentProps<typeof Select>;
type FormSelectProps = Omit<SelectProps, 'onChange'>;
function FormSelectWithRef(
{ name,... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import type { ComponentProps, ForwardedRef } from 'react';
import { forwardRef } from 'react';
import type { UseFormRegisterReturn } from 'react-hook-form';
import { TextAr<|fim_suffix|>f(FormTextAreaWithRef);
export default FormTextArea;
<|fim_middle|>ea } from '~/ui';
type TextAreaProps = ComponentPro... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import<|fim_suffix|> );
}
const FormTextInput = forwardRef(FormTextInputWithRef);
export default FormTextInput;
<|fim_middle|> type { ComponentProps, ForwardedRef } from 'react';
import { forwardRef } from 'react';
import type { UseFormRegisterReturn } from 'react-hook-form';
import { TextInput } from ... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import { useEffect } from 'react';
import { useState } from 'react';
import { ArrowUpRightIcon } from '@heroicons/react/24/outline';
import { JobType } from '@prisma/client';
import { Alert, Button, HorizontalDivider, Spinner, Tabs } from '~/ui';
import OfferPercentileAnalysisText from './OfferPercentile... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import { OVERALL_TAB } from '../constants';
import type { AnalysisUnit } from '~/types/offers';
type OfferPercentileAnalysisTextProps = Readonly<{
analysis: AnalysisUnit;
isSubmission: boolean;
tab: string;
}>;
export default function OfferPercentileAnalysisText({
tab,
analysis: { noOfOffers,... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import {
ArrowTrendingUpIcon,
BuildingOfficeIcon,
MapPinIcon,
} from '@heroicons/react/20/solid';
import {
ArrowTopRightOnSquareIcon,
BuildingOffice2Icon,
CalendarDaysIcon,
} from '@heroicons/react/24/outline';
import { JobType } from '@prisma/client';
import CompanyProfileImage from '~/compo... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import { signIn, useSession } from 'next-auth/react';
import type { UseQueryResult } from 'react-query';
import { DocumentDuplicateIcon } from '@heroicons/react/20/solid';
import { BookmarkIcon as BookmarkOutlineIcon } from '@heroicons/react/24/outline';
import { BookmarkIcon as BookmarkSolidIcon } from '... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>}
isSubmission={true}
/>
)}
</div>
);
}
<|fim_prefix|>import OfferAnalysis from '../offerAnalysis/OfferAnalysis';
import type { ProfileAnalysis } from '~/types/offers';
type Props = Readonly<{
analysis?: ProfileAnalysis | null;
isError: boolean;
isLoading: boolean;
}>;... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>mutationpath =
editProfileId && editToken
? 'offers.profile.update'
: 'offers.profile.create';
const createOrUpdateMutation = trpc.useMutation([mutationpath], {
onError(error) {
console.error(error.message);
showToast({
title:
editProfileId && editToken... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|> />
</div>
</div>
</Collapsible>
</FormSection>
);
}
type FullTimeJobFieldsProps = Readonly<{
defaultCurrency: string;
}>;
function FullTimeJobFields({ defaultCurrency }: FullTimeJobFieldsProps) {
const { register, formState } = useFormContext<{
background: Backg... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>Values
: defaultInternshipOfferValues,
)
}
/>
</div>
);
}
type OfferDetailsFormProps = Readonly<{
defaultCurrency: string;
}>;
export default function OfferDetailsForm({
defaultCurrency,
}: OfferDetailsFormProps) {
const watchJobType = useWatch({
nam... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>className="mr-1 h-5 text-slate-400" />
<span className="ml-1">{school}</span>
</div>
)}
</div>
{(startDate || endDate) && (
<div className="font-light text-slate-400">
<p>{`${startDate || 'N/A'} - ${endDate || 'N/A'}`}</p>
... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>gotiation Strategy
</dt>
<dd className="mt-1 text-sm text-slate-900">
{negotiationStrategy}
</dd>
</div>
)}
{otherComment && (
<div className="col-span-2">
<dt className="text-sm font-medium... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import { signIn, useSession } from 'next-auth/react';
import { useState } from 'react';
import { ClipboardDocumentIcon, ShareIcon } from '@heroicons/react/24/outline';
import { Button, Spinner, TextArea, useToast } from '~/ui';
import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics';
imp... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import { useState } from 'react';
import {
AcademicCapIcon,
ArrowPathIcon,
BriefcaseIcon,
} from '@heroicons/react/24/outline';
import { Button, Spinner } from '~/ui';
import EducationCard from '~/components/offers/profile/EducationCard';
import OfferCard from '~/components/offers/profile/OfferCard... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|> <p>
<span className="mr-2 font-bold">Current:</span>
{`${experiences[0].company?.name || ''} ${
experiences[0].jobLevel || ''
} ${experiences[0].jobTitle || ''} ${
experiences[0].jobType
... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>type ProfilePhot<|fim_suffix|>}: ProfilePhotoHolderProps) {
const sizeMap = { lg: '16', sm: '12', xs: '10' };
return (
<span
className={`inline-block h-${sizeMap[size]} w-${sizeMap[size]} overflow-hidden rounded-full bg-slate-100`}>
<svg
className="h-full w-full text-slate-300"... | fim | yangshun/tech-interview-handbook | typescript |
import { formatDistanceToNow } from 'date-fns';
import { signIn, useSession } from 'next-auth/react';
import { useState } from 'react';
import { Button, Dialog, TextArea, useToast } from '~/ui';
import ProfilePhotoHolder from '~/components/offers/profile/ProfilePhotoHolder';
import { trpc } from '~/utils/trpc';
impo... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>lassName="space-y-2" role="list">
{comment.replies.map((reply) => (
<li key={reply.id}>
<CommentCard
comment={reply}
disableReply={true}
profileId={profileId}
token={token}
... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import clsx from 'clsx';
import type { OfferTableSortType } from '~/components/offers/table/t<|fim_suffix|>className={clsx(
'bg-slate-100 px-4 py-3',
sortType &&
'hover:cursor-pointer hover:bg-slate-200 active:bg-slate-300',
header !== 'Company' && 'whitespace-nowrap',
... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import clsx from 'clsx';
import Link from 'next/link';
import { JobType } from '@prisma/client';
import CompanyProfileImage from '~/components/shared/CompanyProfileImage';
import type { JobTitleType } from '~/components/shared/JobTitles';
import { getLabelForJobTitleType } from '~/components/shared/JobTi... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import { useRouter } from 'next/router';
import { useEffect, useMemo, useRef, useState } from 'react';
import { JobType } from '@prisma/client';
import { DropdownMenu, Spinner, useToast } from '~/ui';
import { useGoogleAnalytics } from '~/components/global/GoogleAnalytics';
import OffersRow from '~/compo... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>er;
handlePageChange: (page: number) => void;
isInitialFetch?: boolean;
isLoading?: boolean;
pagination: Paging;
startNumber: number;
}>;
export default function OffersTablePagination({
isInitialFetch,
isLoading,
endNumber,
pagination,
startNumber,
handlePageChange,
}: OffersTablePa... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>// eslint-disable-next-line no-shadow
export enum YOE_CATEGORY {
ENTRY = 'entry',
INTERN = 'intern',
MID = 'mid',
SENIOR = 'senior',
}
export const YOE_CATEGORY_PARAM: Record<string, number> = {
entry: 1,
intern: 0,
mid: 2,
senior: 3,
};
export const OfferTableYoeOptions = [
{ label: '... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import type { JobType } from '@prisma/client';
import type { MonthYear } from '~/components/shared/MonthYearPicker';
import type { OffersCompany } from '../../types/offers';
import type { Location } from '~/types/offers';
/**
* Form data types
*/
export type OffersProfileFormData = {
background: ... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>{ className: 'tooltip-arrow' })} />
</div>
)}
</>
);
}
<|fim_prefix|>import type { ReactNode } from 'react';
import { usePopperTooltip } from 'react-popper-tooltip';
import type { Placement } from '@popperjs/core';
type TooltipProps = Readonly<{
children: ReactNode;
placement?: Pl... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import clsx from 'clsx';
import type { PropsWithChildren } from 'react';
import { useMemo } from 'react';
import { Fragment, useRef, useState } from 'react';
import { Menu, Transition } from '@headlessui/react';
import { CheckIcon, HeartIcon, PlusIcon } from '@heroicons/react/20/solid';
import {
useAdd... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import { useState } from 'react';
import { useProtectedCallback } from '~/utils/quest<|fim_suffix|>ld">
Just completed your interview? Contribute your questions
</p>
</div>
</button>
<ContributeQuestionDialog
show={showDraftDialog}
onCancel={handl... | fim | yangshun/tech-interview-handbook | typescript |
import { Fragment, useState } from 'react';
import { Dialog, Transition } from '@headlessui/react';
import { HorizontalDivider, useToast } from '~/ui';
import DiscardDraftDialog from './DiscardDraftDialog';
import type { ContributeQuestionFormProps } from './forms/ContributeQuestionForm';
import ContributeQuestionForm... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import { useForm } from 'react-hook-form';
import { Button, Dialog, TextInput } from '~/ui';
import { useFormRegister } from '~/utils/questions/useFormRegister';
export type CreateListFormData = {
name: string;
};
export type CreateListDialogProps = {
onCancel: () => void;
onSubmit: (data: Cr<|fi... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>is list? This action cannot be undone.
</p>
</Dialog>
);
}
<|fim_prefix|>import { Button, Dialog } from '~/ui';
export type DeleteListDialogProps = {
onCancel: () => void;
onDelete: () => void;
show: boolean;
};
export default function DeleteListDialog({
show,
onCancel,
onDelete,
... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import { Button, Dialog } from '~/ui';
export type DiscardDraftDialogProps = {
onCancel: () => void;
onDiscard: () => void;
show: boolean;
};
export default function DiscardDraftDialog({
show,
onCancel,
onDiscard,
}: DiscardDraftDia<|fim_suffix|>ogProps) {
return (
<Dialog
isShown... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>imp<|fim_suffix|>t { Spinner } from '~/ui';
export default function FullScreenSpinner() {
return (
<div className="flex h-full w-full items-center justify-center">
<Spinner size="lg" />
</div>
);
}
<|fim_middle|>or<|endoftext|> | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>Location] = useState<
(Location & TypeaheadOption) | undefined
>(defaultLocation);
const [questionType, setQuestionType] =
useState<QuestionsQuestionType>('CODING');
const handleChangeCompany = (newCompany: FilterChoice) => {
setCompany(newCompany);
};
const handleChangeLocation =... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import type { UseInfiniteQueryResult } from 'react-query';
import { Button } from '~/ui';
export type PaginationLoadMoreButtonProps = {
query: UseInfiniteQueryResult;
};
export default function PaginationLoadMoreButton(
props: PaginationLoadMoreButtonProps,
) {
const {
query: { data, hasNextPa... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import { useMemo } from 'react';
import { usePopperTooltip } from 'react-popper-tooltip';
import 'react-popper-tooltip/dist/styles.css';
export type QuestionAggregateBadgeProps = Readonly<{
icon: (props: React.ComponentProps<'svg'>) => JSX.Element;
statistics: Record<string, number>;
}>;
export def... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>// TODO: Remove this after Steps
import clsx from 'clsx';
import React from 'react';
type Props = Readonly<{
children: React.ReactNode;
className?: string;
variant?: 'md' | 'sm' | 'xs';
}>;
export default function QuestionContainer({
children,
className,
variant = 'md',
}: Props) {
return... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import {
AdjustmentsHorizontalIcon,
MagnifyingGlassIcon,
} from '@heroicons/react/24/outline';
import { Button, Tabs, TextInput } from '~/ui';
import { SORT_ORDERS } from '~/utils/questions/constants';
import type { SortOptionsSelectProps } from './SortOptionsSelect';
import { SortOrder, SortType }... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>Badge>;
const variantMap: Record<QuestionsQuestionType, BadgeVariant> = {
BEHAVIORAL: 'danger',
CODING: 'info',
SYSTEM_DESIGN: 'warning',
THEORY: 'success',
};
const iconMap: Record<QuestionsQuestionType, Required<BadgeProps>['endAddOn']> =
{
BEHAVIORAL: ChatBubbleLeftRightIcon,
CODING... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|> 'Tech Interview Question Bank',
titleHref: '/questions',
};
export default config;
<|fim_prefix|>import type { ProductNavigationItems } from '~/components/global/ProductNavigation';
const navi<|fim_middle|>gation: ProductNavigationItems = [
{ href: '/questions/browse', name: 'Browse' },
{ href: '... | fim | yangshun/tech-interview-handbook | typescript |
import { Select } from '~/ui';
import { SORT_ORDERS, SORT_TYPES } from '~/utils/questions/constants';
import type { SortOrder, SortType } from '~/types/questions.d';
export type SortOption<Value> = {
label: string;
value: Value;
};
type SortOrderProps<Order> = {
onSortOrderChange?: (sortValue: Order) => void;
... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import clsx from 'clsx';
import React from 'react';
import { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/24/outline';
import type { Vote } from '@prisma/client';
import { useProtectedCallback } from '~/utils/questions/useProtectedCallback';
export type BackendVote = {
id: string;
vote: V... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>/div>
</article>
);
}
<|fim_prefix|>import clsx from 'clsx';
import { formatDistanceToNow } from 'date-fns';
import { ChatBubbleLeftRightIcon } from '@heroicons/react/24/outline';
import useAnswerVote from '~/utils/questions/vote/useAnswerVote';
import type { VotingButtonsProps } from '../VotingBu... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>ard {...props} votingButtonsSize="md" />;
}
<|fim_prefix|>import type { AnswerCardProps } from './AnswerCard';
import AnswerCard from './AnswerCard';
export type FullAnswerCardProps = Omit<
AnswerCardProps,
'commentCount' | 'vo<|fim_middle|>tingButtonsSize'
>;
export default function FullAnswerCard(... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import withHref from '~/utils/questions/withHref';
import type { AnswerCardProps } from './AnswerCard';
import AnswerCard from './AnswerCard';
export type QuestionAnswerCardProps = Required<
Omit<AnswerCardPr<|fim_suffix|>ttonsSize="sm" />;
}
const QuestionAnswerCard = withHref(QuestionAnswerCardWith... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|> showActionButton: true;
}
| {
actionButtonLabel?: never;
onActionButtonClick?: never;
showActionButton?: false;
};
type ReceivedStatisticsProps =
| {
receivedCount: number;
showReceivedStatistics: true;
}
| {
receivedCount?: never;
showReceive... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import type { BaseQuestionCardProps } from './BaseQuestionCard';
import BaseQu<|fim_suffix|>CreateEncounterButton'
| 'showDeleteButton'
| 'showReceivedStatistics'
| 'showVoteButtons'
>;
export default function FullQuestionCard(props: QuestionOverviewCardProps) {
return (
<BaseQuestionCard
... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>istics'
| 'showDeleteButton'
| 'showVoteButtons'
>;
function QuestionListCardWithoutHref(props: QuestionListCardProps) {
return (
<BaseQuestionCard
// eslint-disable-next-line @typescript-eslint/no-explicit-any
{...(props as any)}
showActionButton={false}
showAggregateSt... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>rue}
showVoteButtons={true}
/>
);
}
const QuestionOverviewCard = withHref(QuestionOverviewCardWithoutHref);
export default QuestionOverviewCard;
<|fim_prefix|>import withHref from '~/utils/questions/withHref';
import type { BaseQuestionCardProps } from './BaseQue<|fim_middle|>stionCard';
imp... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>ton: true;
showDeleteButton: false;
showHover: true;
showReceivedStatistics: false;
showVoteButtons: false;
},
| 'actionButtonLabel'
| 'onActionButtonClick'
| 'showActionButton'
| 'showAggregateStatistics'
| 'showAnswerStatistics'
| 'showCreateEncounterButton'
| 'showDelete... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import useAnswerCommentVote from '~/utils/questions/vote/useAnswerCommentVote';
import type { CommentListItemPr<|fim_suffix|>ntListItem
vote={vote}
onDownvote={handleDownvote}
onUpvote={handleUpvote}
{...restProps}
/>
);
}
<|fim_middle|>ops } from './CommentListItem';
import... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import { formatDistanceToNow } from 'date-fns';
import type { BackendVote } from '../VotingButtons';
import VotingButtons from '../VotingButtons';
export type CommentListItemProps = {
authorImageUrl: string;
authorName: string;
content: string;
createdAt: Date;
onDownvote: () => void;
onUpvo... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import useQuestionCommentVote from '~/utils/questions/vote/useQuestionCommentVote';
import type { CommentListItemProps } from './CommentListItem';
import CommentListItem from './CommentListItem';
export type QuestionCommentListItemProps = Omit<
CommentListItemProps,
'onDownvote' | 'onUpvote' | 'vote... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import { useMemo } from 'react';
import type { UseFormRegisterReturn } from 'react-hook-form';
import { useForm } from 'react-hook-form';
import { CheckboxInput, CheckboxList, Collapsible, RadioList } from '~/ui';
export type FilterChoice<V extends string = string> = {
id: string;
label: string;
va... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import { startOfMonth } from 'date-fns';
import { useEffect, useState } from 'react';
import { Controller, useForm } from 'react-hook-form';
import { Arro<|fim_suffix|>Discard,
onSimilarQuestionFound,
onSubmit,
}: ContributeQuestionFormProps) {
const {
control,
register: formRegister,
ha... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>ssName="flex flex-wrap items-center gap-2">
<p className="text-md text-slate-600">
I saw this question {step <= 1 ? 'at' : step === 2 ? 'for' : 'on'}
</p>
{step === 0 && (
<div>
<CompanyTypeahead
isLabelHidden={true}
placeholder="Company"... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import type { PropsWithChildren } from 'rea<|fim_suffix|>LeftIcon}
label="Back"
size="sm"
variant="secondary"
/>
</div>
<div className="flex w-full justify-center overflow-y-auto">
{children}
</div>
</Container>
);
}
<|fim_middle|>ct';
... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|> showDialog: () => {},
});
export type ProtectedContextProviderProps = PropsWithChildren<
Record<string, unknown>
>;
export default function ProtectedContextProvider({
children,
}: ProtectedContextProviderProps) {
const [show, setShow] = useState(false);
return (
<ProtectedContext.Provider
... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import { signIn } from 'next-auth/react';
import { Button, Dialog } from '~/ui';
export type ProtectedDialogProps = {
onClose: () => void;
show: boolean;
};
export default function ProtectedDialog({
show,
onClose,
}: ProtectedDialogProps) {
const handlePrimaryClick = () => {
signIn();
... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import { useState } from 'react';
import useCompanyOptions from '~/utils/shared/useCompanyOptions';
import type { ExpandedTypeaheadProps } from './ExpandedTypeahead';
import ExpandedTypeahead from './ExpandedTypeahead';
export type CompanyTypeaheadProps = Omit<
ExpandedTypeaheadProps,
'label' | 'on... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>v>
);
}
<|fim_prefix|>import type { ComponentProps } from 'react';
import { useState } from 'react';
import { useMemo } from 'react';
import { Button, Typeahead } from '~/ui';
import type { RequireAllOrNone } from '~/utils/questions/RequireAllOrNone';
type TypeaheadProps = ComponentProps<typeof Typeah... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>g={isLoading}
{...({
onSuggestionClick: onSuggestionClick
? (option: TypeaheadOption) => {
const location = locationOptions.find(
(locationOption) => locationOption.id === option.id,
)!;
onSuggestionClick({
.... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import { useState } from 'react';
import useJobTitleOptions from '~/utils/shared/useJobTitleOptions';
import type { ExpandedTypeaheadProps } from './ExpandedTypeahead';
import ExpandedTypeahead from './ExpandedTypeahead';
export type RoleTypeaheadProps = <|fim_suffix|> ExpandedTypeaheadProps,
'label'... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>umPages, setNumPages] = useState(0);
const [pageNumber, setPageNumber] = useState(1);
const [pageWidth, setPageWidth] = useState(750);
const [componentWidth, setComponentWidth] = useState(780);
const onPageResize = () => {
setComponentWidth(
document.querySelector('#pdfView')?.getBoundi... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import type { ProductNavigationItems } from '~/components/global/ProductNavigation';
const navigation: ProductNavigationItems = [
{ children: [], href: '/resumes/submit', name: 'Submit for review' },
{
children: [],
href: '/resumes/features',
name: 'Features',
},
{
children: [],
... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>fill="#FCEB88"
rx="28.897"
ry="51.747"
transform="matrix(0.2723 -0.9622 0.9622 0.2723 141.702 343.89)"
/>
</svg>
);
}
<|fim_prefix|>import type { ResumeBadgeProps } from '../resume-badge';
export default function ResumeBadgeCoolIcon({ className }: ResumeBadgeProps) {
... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>s="411.281,228.032 414.35,216.392 404.653,223.526 394.13,217.024 398.32,228.437 388.483,236.449 401.033,235.979 405.213,247.822 409.045,235.728 421.199,235.426 "
/>
</g>
<path
d="M383.34,314.795c-5.941-14.345-21.202-36.571-46.212-55.931 c-19.131-14.808-50.218-32.46-89.678-... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>import type { ResumeBadgeProps } from '../resume-badge';
export default function ResumeBadgeTreasureIcon({
className,
}: ResumeBadgeProps) {
return (
<svg
className={className}
viewBox="0 0 511.672 511.672"
x="0px"
xmlns="http://www.w3.org/2000/svg"
y="0px">
<p... | fim | yangshun/tech-interview-handbook | typescript |
<|fim_prefix|>export type ResumeBadgeProps = Readonly<{
className:<|fim_suffix|>string;
}>;
<|fim_middle|> <|endoftext|> | fim | yangshun/tech-interview-handbook | typescript |
<|fim_suffix|>757F"></path>
<path
d="M28.052 21.103c.354.145-2.921 1.378-7.479 1.458c-4.771.084-6.234.39-5.146 1.459c1.146 1.125 2.976 2.892 2.896 3.416c-.081.524-4.172 1.918-4.333 2.562c-.161.645 1.229 5.961 1.229 5.961l8.729-.252c2.565-8.844 2.883-8.501 4.104-13.604c.241-1.008 0-1 0-1z"
fill="#2... | fim | yangshun/tech-interview-handbook | typescript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.